-
Notifications
You must be signed in to change notification settings - Fork 248
Remove NgController and replace with applicationFactory root object #919
Comments
Closes #902 BREAKING CHANGE: - Concepts: - Filter -> Formatter - import: - angular/directive/ng_a.dart -> angular/directive/a_href.dart - angular/filter/currency.dart -> angular/formatter/currency.dart - angular/filter/date.dart -> angular/formatter/date.dart - angular/filter/filter.dart -> angular/formatter/filter.dart - angular/filter/json.dart -> angular/formatter/json.dart - angular/filter/limit_to.dart -> angular/formatter/limit_to.dart - angular/filter/lowercase.dart -> angular/formatter/lowercase.dart - angular/filter/module.dart -> angular/formatter/module.dart - angular/filter/number.dart -> angular/formatter/number.dart - angular/filter/order_by.dart -> angular/formatter/order_by.dart - angular/filter/stringify.dart -> angular/formatter/stringify.dart - angular/filter/uppercase.dart -> angular/formatter/uppercase.dart - Types: - NgA -> AHref - NgAttachAware -> AttachAware - NgDetachAware -> DetachAware - NgShadowRootAware -> ShadowRootAware - NgFilter -> Formatter - NgInjectableService -> Injectable - AbstractNgAnnotation -> Directive - AbstractNgFieldAnnotation -> DirectiveAnnotation - NgComponent -> Component - NgController -> Controller - NgDirective -> Decorator - NgAnimate -> Animate - NgZone -> VmTurnZone - NgAnimationModule -> AnimationModule - NgCoreModule -> CoreModule - NgCoreDomModule -> CoreDomModule - NgAnimationDirective -> NgAnimation - NgAnimationChildrenDirective -> NgAnimationChildren - FilterMap -> FormatterMap - NgAttrMustacheDirective -> AttrMustache - NgTextMustacheDirective -> TextMustache - Constants - NgDirective.LOCAL_VISIBILITY -> Directive.LOCAL_VISIBILITY - NgDirective.CHILDREN_VISIBILITY -> Directive.CHILDREN_VISIBILITY - NgDirective.DIRECT_CHILDREN_VISIBILITY -> Directive.DIRECT_CHILDREN_VISIBILITY
So in future Angular applications a controller can only be the root controller or a component, is that right? I don't have yet enough experience with Angular to be able to tell if this is an advantage or disadvantage. Somehow I found it liberating that in Angular not everything has to be a component when I started working with Angular after working 4 months with Polymer. Of course there are still directives but somehow this seems to restrict Angulars flexibiltiy. Can you please explain the reasoning behind this decision a bit? |
Removing it simplifies the world. The issue is that it makes hello world kinds of apps more complicated, but that will be solved by allowing the root of the app to have its own type and one would get best of all worlds. The issue that everything has to be a component only feels like an issue if the cost of creating them is high. If you have light weight components with decorator-directives then you have all the tools you should need for building your app. |
Thanks a lot for this feedback! There were already several questions on SO and Google groups. I'll add a link to this thread. |
closes dart-archive#919 closes dart-archive#917 It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The RootContext need not be annotated with a directive.
closes dart-archive#919 closes dart-archive#917 It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The RootContext need not be annotated with a directive.
closes dart-archive#919 closes dart-archive#917 It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The RootContext need not be annotated with a directive.
closes dart-archive#919 closes dart-archive#917 1) The @controller annotation is no more It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The RootContext needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in theroot context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get hold of the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 1) The @controller annotation is no more It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The RootContext needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in theroot context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get hold of the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 1) The @controller annotation is no more It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The RootContext needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in theroot context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get hold of the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 1) The @controller annotation is no more It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The RootContext needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in theroot context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get hold of the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 1) The @controller annotation is no more It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The RootContext needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in theroot context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get hold of the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 1) The @controller annotation is no more It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The RootContext needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in theroot context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get hold of the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 1) The @controller annotation is no more It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The RootContext needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in theroot context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get hold of the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 1) The @controller annotation is no more It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The RootContext needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in theroot context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get hold of the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
So whats the work around for @controller then, I cant see a clear explanation? |
Do you have a specific question on what is unclear in the explanation above ? |
Since @controller is now depreciated, how do we construct and annotate our controllers? There is no guidance in the docs following the depreciation, there is no new implementation yet. A clear and plain example would be much appreciated (by many) I also disagree, the example given above is not so clear at least not to me, particularly from a dev like me moving from AngularJS to Dart. Is the "Hello World Object a controller?" How do we reference it in scope, for example can we use an equivalent to publishAs:, especially if there are many controllers? |
You are right: Once #1040 gets merged and released you won't be able to use |
Aha, I see. My IDE (Web storm 8) throws a hissy fit, with it using 0.11.0, ill turn the warnings off, for now, if it still works then the issues is a red herring for now. Thanks for the help, ill keep an eye on the commits! |
Unfortunately |
I have replaced Controllers with Components. To avoid having an extra view HTML file with a single element for my 'some_page': ngRoute( For the angular team: Is this the intend flow moving forward? Also, with Controllers, you could have different templates use a common On Wed, Jun 4, 2014 at 1:19 PM, Anton Moiseev [email protected]
|
@antonmoiseev I am using multiple controllers in my 0.11 app. You just have to provide the html files to the transformer. |
@pcornelissen thanks! Explicitly listing HTML files helped to workaround transformer's issue. However, |
When you build the stuff on the console (that's at least what I do), then pub created all these links to the packages dir. If you're not on linux, this may be different. |
closes dart-archive#919 closes dart-archive#917 1) The @controller has been removed It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The root context type needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in the root context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 1) The @controller has been removed It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The root context type needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in the root context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 1) The @controller has been removed It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The root context type needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in the root context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 1) The @controller has been removed It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The root context type needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in the root context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 1) The @controller has been removed It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The root context type needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in the root context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 1) The @controller has been removed It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The root context type needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in the root context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 1) The @controller has been removed It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The root context type needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in the root context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 1) The @controller has been removed It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The root context type needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in the root context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 1) The @controller has been removed It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The root context type needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in the root context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
closes dart-archive#919 closes dart-archive#917 Backard Compatibility breaks: 1) The @controller has been removed It is possible to define the context of the root scope with: applicationFactory() ..rootContextType(RootContext) ..run(); The root context type needs to be annotated with @Injectable(): @Injectable() class RootContext { // ... } 2) You can not inject a scope in a component or in the root context any more As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.rootScope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope / RootScope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } }
@kinetifex i found your question very important, because it reflect what am searching for too. |
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes dart-archive#919 closes dart-archive#917
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes #919 closes #917
NgController
only makes sense for the top-most scope since there is not an implicit component. All children are created in a form of a component which has its own Controller per #914. BecauseNgController
relies onpublishAs
it is not compatible with the #914 change. So we can bypass this by moving it toapplicationFactory
This is essentially equivalent to
This way the
RootScope
's context is set toHelloWorld
instance.The text was updated successfully, but these errors were encountered: