Why doesn't AppComponent have a default ngOnInit function?

When building an Angular project using the CLI, the root component - AppComponent does not have an ngOnInit block, but every other generated component has an ngOnInit block. Is it wrong to have ngOnInit in the root component?

+3
angular angular-cli


source to share


No one has answered this question yet

Check out similar questions:

563
Huge amount of files generated for each Angular project
378
Angular digital input error - EXCEPTION: Cannot resolve all parameters
209
How to add upload to angular-cli project
168
Checking the angular-cli version installed?
164
Angular 2 Use a component from another module
164
Angular CLI SASS Options
151
How to generate components in a specific folder using angular-cli?
106
angular2 how to change default prefix of component to stop tslint warnings
101
You must be inside the angular-cli project to use the build command after reinstalling angular-cli
94
Creating a component for a specific module using Angular-CLI



All Articles
Loading...
X
Show
Funny
Dev
Pics