mirror of
https://github.com/angular/angular.git
synced 2026-11-28 17:37:50 -05:00
docs: Adding type annotation to ngOnInit() to make it consistent with the class structure produced by the CLI (#43579)
PR Close #43579
This commit is contained in:
committed by
Andrew Kushnir
parent
f218644784
commit
158ad09945
@@ -26,7 +26,7 @@ export class HeroesComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ export class HeroesComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
// #docregion on-select
|
||||
|
||||
@@ -18,7 +18,7 @@ export class HeroDetailComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ export class HeroesComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
onSelect(hero: Hero): void {
|
||||
|
||||
@@ -12,7 +12,7 @@ export class HeroDetailComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ export class HeroesComponent implements OnInit {
|
||||
constructor(private heroService: HeroService, private messageService: MessageService) { }
|
||||
|
||||
// #docregion ng-on-init
|
||||
ngOnInit() {
|
||||
ngOnInit(): void {
|
||||
this.getHeroes();
|
||||
}
|
||||
// #enddocregion ng-on-init
|
||||
|
||||
@@ -13,7 +13,7 @@ export class DashboardComponent implements OnInit {
|
||||
|
||||
constructor(private heroService: HeroService) { }
|
||||
|
||||
ngOnInit() {
|
||||
ngOnInit(): void {
|
||||
this.getHeroes();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ export class HeroesComponent implements OnInit {
|
||||
|
||||
constructor(private heroService: HeroService) { }
|
||||
|
||||
ngOnInit() {
|
||||
ngOnInit(): void {
|
||||
this.getHeroes();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export class DashboardComponent implements OnInit {
|
||||
|
||||
constructor(private heroService: HeroService) { }
|
||||
|
||||
ngOnInit() {
|
||||
ngOnInit(): void {
|
||||
this.getHeroes();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export class HeroesComponent implements OnInit {
|
||||
|
||||
constructor(private heroService: HeroService) { }
|
||||
|
||||
ngOnInit() {
|
||||
ngOnInit(): void {
|
||||
this.getHeroes();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user