Monday, January 21, 2019

Angular - Constructor vs. ngOnInit

Constructor is called when the class is instantiated. It is a good place to initialize class properties and inject dependencies.

ngOnInit is a lifecycle hook and is called after the constructor is called and all the variables are initialized. 

Order of Events


1 comment:

Deploying ASP.NET MVC app on Ubuntu

.NET 10 MVC Deployment on Ubuntu with Nginx, systemd, PostgreSQL & Cloudflare Architecture: Browser → Cloudflare (Flexible SSL)...