I\'m trying to make a shared service for my app.
import { Injectable } from \'@angular/core\';
@Injectable()
export class SharedService {
testService() {
You need to set who's the provider for that service with providers
keyword in @Component
or @NgModule
annotation. This is well documented already zilion times, see:
https://angular.io/docs/ts/latest/guide/dependency-injection.html#!#injector-providers
https://angular.io/docs/ts/latest/guide/ngmodule.html#!#providers
https://angular.io/docs/ts/latest/cookbook/component-communication.html
https://angular.io/docs/ts/latest/cookbook/dependency-injection.html