Explain the difference between constructor and ngoninit in angular 6?
Answer / Meghna Singh
In Angular, the Constructor is a method that is called when an instance of a component or service is created. It is used to initialize properties and set up dependencies. The `ngOnInit` lifecycle hook, on the other hand, is called after the component's properties have been initialized and is used to perform any additional setup or initialization that requires data from services or other sources.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is a controller?
What is a typescript decorator?
What is fxflex in angular?
Why is lazy evaluation good?
What is ng command?
What is the urlsegment interface in angular 7?
What is angular json file?
What is * ngfor?
What's new in angular 8?
Explain what are directives ? Mention some of the most commonly used directives in Angular.js application ?
Who made redux?
What do I have to do to trick the browser into doing what I want?