2
votes

In the angular dart documentation it says best practice is to declare your controllers using controller annotations. But I get an error when trying to do that stating that annotations must be a constant variable. Digging into the source I can see that there is no controller annotation in angular dart 1.0

From package:angular/core/annotation.dart

export "package:angular/core/annotation_src.dart" show
    AttachAware,
    DetachAware,
    ShadowRootAware,

    Formatter,
    DirectiveBinder,
    DirectiveBinderFn,

    Directive,
    Component,
    Decorator,
    Visibility,

    DirectiveAnnotation,
    NgAttr,
    NgCallback,
    NgOneWay,
    NgOneWayOneTime,
    NgTwoWay;

Has the controller annotation been depreciated? If so, what is the best practice for instantiating a controller?

1

1 Answers

1
votes

Controller were removed in Angular.dart 1.0.

There is a rootContext which is a controller initialized at application startup, otherwise use a component instead of a controller.

See for an example