Note: this answer applies only to corner components and directives, NOT to services.
I had the same problem when ngOnInit (and other lifecycle hooks) didn't ngOnInit my components, and most searches led me here.
The problem is that I used the syntax of the arrow function ( => ) as follows:
class MyComponent implements OnInit {
Obviously this does not work in Angular 6. Using function syntax without an arrow solves the problem:
class MyComponent implements OnInit { public ngOnInit() { console.log("ngOnInit"); } }
AJ Richardson May 29 '18 at 14:15 2018-05-29 14:15
source share