I'm doing a presentation on Angular 2 and I'd like to show how to use pure
ES5 without the DSL to create Angular code. The one thing I can't figure
out is how to annotate a constructor function.
Here's an example:
function PhoneService() {
this.phones = [];
}
// How do I annotate this so Angular knows I need a PhoneService?
function AppComponent(PhoneService) {
this.phones = PhoneService.phones;
}
AppComponent.annotations = [
new ng.core.Component({
selector: 'my-app',
templateUrl: 'app/app.html'
})];
document.addEventListener('DOMContentLoaded', function() {
ng.platform.browser.bootstrap(AppComponent, [PhoneService]);
});
Thanks!
John
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.