Vitaliy
Member since Nov 1, 2017
- Profile: /members/13648-vitaliy.htm
- Comments: 1
Recent Blog Comments By Vitaliy
-
ngOnInit() May Not Get Called Before ngOnDestroy() Is Called In Angular 4.4.6
Posted on Nov 1, 2017 at 1:08 PM
Hi, It is incorrect use of constructor. You should use constructor only for injecting dependencies and you should move this logic to ngOnInit. It is the same as pass the street on the red light. You may (use logic in constructor), but very often it can cause accident (the absence of ngOnInit). G... read more »