New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Abstract tokens #7984
feat: Abstract tokens #7984
Conversation
BREAKING CHANGE: Previously Title was exported. Now Title has been renamed to TitleImpl
/** | ||
* An interface to get the Global object | ||
*/ | ||
export abstract class Global { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps window is a better name after all when considering window as the context of where the app is run (iFrame, node context, browser, web worker)
#7979 (comment)
GlobalContext
, Window
, or maybe even Context
may also work
fix(platform/tokens): correct export Types fix(platform/browser_common): _location() use getLocation() style(platform/tokens): remove abstract for props test(title): inject Title refactor(public_api): remove Title style(Title): clang format
30f4fd8
to
45d38ee
Compare
Could you explain the reason why the Title was hidden? It seems like something which should be public. |
@mhevery If you're referring to the |
@@ -3,12 +3,12 @@ import {DOM} from 'angular2/src/platform/dom/dom_adapter'; | |||
/** | |||
* A service that can be used to get and set the title of a current HTML document. | |||
* | |||
* Since an Angular 2 application can't be bootstrapped on the entire HTML document (`<html>` tag) | |||
* When an Angular 2 application is not bootstrapped on the entire HTML document (`<html>` tag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean you actually can do that? I mean, sure you can, but that purges the entire <head>
and I wouldn't assume someone would actually want that. This text sounds to me like bootstrapping Angular to <html>
is the common case and for edge cases the Title
service can be used.
Just my 2c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is right. Even if I bootstrap part of the DOM I should still be able to access the title. I think a better way to think about it is that the Title
should be part of the platform
injector, since there is only one injector
per page.
Alternative way to think about it is that Title
is owned by each application
. When you write to the title you clober whatever there was before. (ie, if multiple applications bootstrap on a single page then the last write to the API wins.)
OK, I thought about it some more, and I am not convinced that the the I am leaning against this refactoring. Please provide reasons why you think this should move? |
no new activity, closing |
moving |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
feature
Every 3rd party module needs to create their own Location service (e.g. the component router)
Creates a better contract for Universal code, 3rd party modules, and testing similar to
$window
in Angular 1Yes, Previously the
Title
service was exportedcc @jeffbcross