Simon_Weaver
Simon_Weaver

Reputation: 146110

Angular TypeError: "provider.ngAfterViewInit is not a function at callProviderLifecycles"

I get the error

evt = TypeError: provider.ngAfterViewInit is not a function at callProviderLifecycles

in my Angular project. The mysterious thing is that not only do I not have an ngAfterViewInit method but I also don't have the corresponding implements clause.

The even odder thing is that I undo my file back to a previous state and it starts working again.

Upvotes: 9

Views: 1562

Answers (1)

Simon_Weaver
Simon_Weaver

Reputation: 146110

It seems that something in the CLI caches which methods existed at some point in time.

I am using ng serve --source-map=false --aot --live-reload=false

Restarting ng serve cleared out whatever was caching this.

Upvotes: 8

Related Questions