You have to use providers
instead of injectables
@Component({
selector: 'my-app',
providers: [NameService]
})
More Related Contents:
- How do I actually deploy an Angular 2 + Typescript + systemjs app?
- How to prepare release version with SystemJS and Gulp?
- How do you deploy Angular apps?
- Expression ___ has changed after it was checked
- *ngFor running an infinite loop in angular2
- Angular 2 @ViewChild annotation returns undefined
- How to get query params from url in Angular 2?
- How to inject Document in service?
- When I refresh my website I get a 404. This is with Angular2 and firebase
- Angular 2 Show and Hide an element
- WARNING: sanitizing unsafe style value url
- Angular2: How to load data before rendering the component?
- Extending component decorator with base class decorator
- How can I listen for keypress event on the whole page?
- How to display json object using *ngFor
- How to avoid imports with very long relative paths in Angular 2?
- Select based on enum in Angular2
- Accessing a property in a parent Component
- TypeScript error in Angular2 code: Cannot find name ‘module’
- angular2 bootstrap with data from ajax call(s)
- How to use select/option/NgFor on an array of objects in Angular2 [duplicate]
- Get route query params
- RxJs get value from observable
- How to create an Observable from static data similar to http one in Angular?
- Angular 2 ngModel in child component updates parent component property
- Angular2 – root relative imports
- Angular2 HTTP GET – Cast response into full object
- Angular 2 loader on each http request
- detect change of nested property for component input
- How to place a dynamic component in a container