What are differences between constructors and oninit?
Answer / Ankur Agarwal
The main difference between a constructor and $onInit in AngularJS is that the constructor initializes the component's properties before any data-binding has occurred, while $onInit gets called once when the component has been initialized and its properties are available.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is route snapshot?
What is @ngmodule in angular 2? Explain
What is the use of ngfor directive in angular?
What is latest version of angularjs?
What is the purpose of a filter in angular?
Is angular 7 released?
What is angularjs expression?
What is ngoninit in angular?
What’s the difference between form, formgroup, and formcontrol? How do they work together?
How to display the error message from backend in angular2?
Which of the following directive is used to initialize an angular app?
Explain currency filter and when to use it?