docs: update examples for tree-shakeable providers (#22961)

PR Close #22961
This commit is contained in:
Alex Rickabaugh
2018-03-23 08:36:48 -07:00
parent ed53c5ccdd
commit e1ea7ed019
25 changed files with 154 additions and 13 deletions

View File

@ -8,6 +8,5 @@ import { HeroService } from './heroes';
template: `
<toh-heroes></toh-heroes>
`,
providers: [HeroService]
})
export class AppComponent {}

View File

@ -5,7 +5,9 @@ import { Observable, of } from 'rxjs';
import { Hero } from './hero.model';
@Injectable()
@Injectable({
providedIn: 'root',
})
export class HeroService {
getHeroes() {
let heroes: Hero[] = [];