The following shows what to watch out for when making Angular Dart applications. For more information about Angular Dart, see angulardart.org.
- 
Provide ng-appattribute inhtmlelement<html ng-app> </html> 
- 
Add shadow_dom.min.jsanddart.jsscripts into html<script src="packages/shadow_dom/shadow_dom.min.js"></script> <script src="packages/browser/dart.js"></script> 
- 
Import the angular dart library import 'package:angular/angular.dart'; 
- 
Provide the temporary fix using the Mirrors annotation @MirrorsUsed(override:'*') import 'dart:mirrors'; 
- 
Call ngBootstrapmethod inmainvoid main { ngBootstrap(); } 
- 
Put the @NgControllerannotation before the class declaration@NgController ( ... ) class MyControllerClass { ... 
- 
Define the selectorandpublishAsattributes to the@NgControllerannotation@NgController ( selector: '...', publishAs: '...' ) 
- 
Put the selectorname in brackets@NgController ( selector: '[mycontroller]' ) 
- 
Provide name of publishAsto be referenced from html@NgController ( selector: '...', publishAs: 'ctrl' ) 
- 
Define an extending Moduleclassclass MyModule extends Module { ... } 
- 
Provide your Controller class into the typemethod in its constructorclass MyModule extends Module { MyModule() { type(MyControllerClass); } } 
- 
Call extending Moduleclass's constructor inngBootstrapmethod callngBootstrap(module: new MyModule()); 
- 
Provide the @NgOneWay,@NgTwoWay, or@NgAttrannotation before the property@NgOneWay int value; // Can be any type. @NgTwoWay int value; // Can be any type. @NgAttr String value; // String only. 
- 
Provide controller selector in parent HTML element <div mycontroller></div> 
- 
Reference property or method in {{}}as member ofpublishAsannotation of controller<input ng-model="{{ctrl.property}}"> <button ng-click="{{ctrl.method()}}">Click Me</button> 
- 
Put the @NgComponentannotation before the class declaration@NgComponent ( ... ) class MyComponentClass { ... 
- 
Define the selector,templateUrl,cssUrl, andpublishAsattributes to the@NgComponentannotation@NgComponent ( selector: 'mycomponentselector', templateUrl: 'path/to/component/html', cssUrl: 'path/to/component/css', publishAs: 'cmp' ) 
- 
Add reference to Component class in typecall of extendedModuleclass constructorclass MyModule extends Module { MyModule() { ... type(MyComponent); ... } } 
- 
Declare component selectoras element name in HTML<html ng-app> ... <mycomponentselector ...></mycomponentselector> 
- 
Add @NgInjectableService()annotation before the class definition of the service@NgInjectableService() class MyService { ... 
- 
Call service methods from Controller MyService ns; void someMethod { ... ns.methodCall(); ... } 
- 
Add service class name to typecall of extendedModuleclass constructorclass MyModule extends Module { ... type(MyService); ... } 
- 
Provide @NgFilter annotation before class definition @NgFilter(name: '...') class MyFilter { ... 
- 
Provide selector name to @NgFilter annotation @NgFilter(name: 'myfilter') 
- 
Register custom Filter class to extended Module class constructor class MyModule extends Module { MyModule() { ... type(MyFilter); ... } } 
- 
Provide filter selector name to value subjected to filtering <input value="{{ctrl.value | myfilter}}">