On generating an Angular project using the CLI, the root component - AppComponent does not have an ngOnInit block but every other component generated has an ngOnInit block. Is it wrong to have an ngOnInit in the root component?
There's nothing wrong to have an ngOnInit in the root component. But there is no need.
By the definition, root component is just called once like <app-root></app-root> in the index.html. And not called by any other components. thus, root component would not have @Input() bindings that ngOnInit assured set properly.
not-viable.component.html:
<app-root [someInput]="variable"></app-root>
Conclusion
You can have ngOnInit in the root component, but constructor can do the same thing without any flaw.