Injection in Angular 2. How does it work?
问题 I've been learning Angular 2 for a few days now. When I read about the Injectable() concept in Angular 2 and try to apply the tutorial's example code in this link : Angular 2 - Dependency Injection, I get a problem. They said I need to put the annotation @Injectable() on top of the class so that the other classes can inject, like: import { Injectable } from '@angular/core'; @Injectable() export class appService { getApp(): string { return "Hello world"; } } The problem is that when I drop