Angular4 : Angular Life cycle hooks
For more info plz visit:https://www.youtube.com/watch?v=RCLwwWQ8-V0&t=48s
1. Creates the component
2. Renders the component
3. Creates and renders the component children
4. Checks when the component data-bound properties change, and
5 Destroy the component before removing it from the DOM
1> Constructor call => Before component loads
2> Example of "ngOnChanges" => If value for any of the property is changed.
Below eg has 2 components, "simple" component is added inside "my-app" component
And if we enter any thing in text box same thing we are passing to another component using [simpleInput] => @Input() option
3> ngOnInit => after component loads
Like service call (eg: service.getEmployeeList()) and bind to variable.
No comments:
Post a Comment