You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OnInit is not added to new components any more #48575
when I create components using ng g c component name , in my ts file ngOnInit and constructor are not creating.. I have to type that manually..using latest angular version..please help me i am new to this angualr
@athirakarakkodath Since the latest angular, this has been removed from the generate component schematic. So you will need to add lifecycle interfaces yourself. ( And also don't need to remove them incase they are not needed )
Activity
JeanMeche commentedon Dec 22, 2022
Thank you for reporting that, I've open a PR to update the tutorial.
athirakarakkodath commentedon Dec 24, 2022
when I create components using ng g c component name , in my ts file ngOnInit and constructor are not creating.. I have to type that manually..using latest angular version..please help me i am new to this angualr
JelleBruisten commentedon Dec 24, 2022
@athirakarakkodath Since the latest angular, this has been removed from the generate component schematic. So you will need to add lifecycle interfaces yourself. ( And also don't need to remove them incase they are not needed )
docs: remove onInit from Tour Of Heroes.
docs: remove onInit from Tour Of Heroes. (#48576)
docs: remove onInit from Tour Of Heroes. (#48576)
docs: remove onInit from Tour Of Heroes. (angular#48576)
angular-automatic-lock-bot commentedon Feb 5, 2023
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.