Why is it not a good practice to write initialization logic in the constructor in angular 2

Discussão em 'Angular' iniciado por stack shalini, Fevereiro 5, 2025.

  1. Why do we write initialization logic only in the OnInit() method and not in constructor method? What are all the side effects of using constructor method for initialization? Please explain.

    Continue reading...

Compartilhe esta Página