Question: is ngoninit called before constructor?
Answer: The ngOnInit is called after the constructor is executed. In constructor Angular initializes and resolves all class members so in ngOnInit you can initialize work and logic of the component.