docs: update examples for tree-shakeable providers (#22961)
PR Close #22961
This commit is contained in:
@ -8,6 +8,5 @@ import { HeroService } from './heroes';
|
||||
template: `
|
||||
<toh-heroes></toh-heroes>
|
||||
`,
|
||||
providers: [HeroService]
|
||||
})
|
||||
export class AppComponent {}
|
||||
|
@ -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[] = [];
|
||||
|
Reference in New Issue
Block a user