-
Notifications
You must be signed in to change notification settings - Fork 1
Service
Rob edited this page Jan 23, 2015
·
5 revisions
With angular-next (and Angular 2.0) any class can be used as a service. In order to register it with Angular you just need to list it in your root component's componentServices.
import {Component, TemplateConfig} from 'core/core.js';
class MyService1 {
}
class MyService2 {
constructor(myService1: MyService1) {
}
}
@Component({
selector: 'my-comp',
componentServices: [MyService1, MyService2],
templateConfig: new TemplateConfig({
inline: '<div>hello</div>'
})
})
class MyComp {
constructor(myservice2: MyService2) {
...
}
}