File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -91,14 +91,19 @@ <h2 class="no-text-transform">A Service is...</h2>
91
91
</ section >
92
92
< section >
93
93
< p class ="no-text-transform "> Component consumes a service making use of the < span class ="highlight "> Dependency Injection</ span > </ p >
94
- < pre > < code class ="hljs typescript " data-trim data-noescape >
94
+ < pre > < code class ="hljs typescript " data-trim data-noescape data-line-numbers =" |5 " >
95
95
@Component({...})
96
96
export class BookOverviewComponent{
97
97
books$ = this.bookService.findAll();
98
98
99
- constructor(private < mark > bookService: BookService</ mark > ) {}
99
+ constructor(private bookService: BookService) {}
100
100
}
101
101
</ code > </ pre >
102
+ < aside class ="notes ">
103
+ Note the access modifier "private" in the constructor parameters. < br >
104
+ bookService will be injected during instantiation by Angular. < br >
105
+ bookService can be used like a usual member variable.
106
+ </ aside >
102
107
</ section >
103
108
< section >
104
109
< section id ="summary ">
You can’t perform that action at this time.
0 commit comments