Angular doc says for ngOnInit
;
Initialize the directive/component after Angular first displays the data-bound properties and sets the directive/component's input properties.
But what does exactly initializing mean ?
Because When I create a component and debug it, component doesn't display data-bound properties
to DOM until ngAfterViewInit
is called. But standart HTML elements are being rendered to the DOM when ngOnInit
is called. Please check the following;
Component HTML
<h1 class="parent-normal"> I'M TRYING TO MAKE SENSE OF ANGULAR</h1> --> Being rendered when ngOninit is called
<div class="parent-data-bound">{{parentDataBound}}</div> -->Not being rendered until ngAfterViewInit is called
<app-child></app-child> --> Same as parent component. Standart HTML elements of child are being rendered when parent's ngOnInit component rendered. But data bound properties are not being rendered until
parent's ngAfterViewInit is rendered
So is the expression wrong what angular doc says ? Because when ngOnInit
is called, data-bound
properties are not being rendered.