1)Explain component life cycle? Angular application goes through an entire set of processes or has a lifecycle right from its initiation to the end of the application. The representation of lifecycle in pictorial representation as follows, The description of each lifecycle method is as below, ngOnChanges: When the value of a data bound property changes, then this method is called. If no property then no call. ngOnInit: This is called whenever the initialization of the directive/component after Angular first displays the data-bound properties happens. ngDoCheck: This is for the detection and to act on changes that Angular can't or won't detect on its own. Called immediately after ngOnChanges() on every change detection run, and immediately after ngOnInit() on the first run. ngAfterContentInit: This is called in response after Angular projects external content into the component's view. Called once after the first ngDoCheck(). ngAfterContentChecked: This is c...
This website contains interview questions for JavaScript, Nodejs, Html, Css, Datastructure, Mongodb, Angular, Aws and much more intresting articles on different technologies.