Tobias Etter
Tobias Etter

Reputation: 774

Angular 2 do not run change function on creation

I have the problem that my change function is called when data from service arrives the first time.

Therefore I tried to set a flag. But NgOnContentInit sets the flag too early.

How can I prevent my change function to be called on creation?

Upvotes: 0

Views: 250

Answers (1)

Sathish Kotha
Sathish Kotha

Reputation: 1111

You can call the change function in ngAfterViewInit. it will load the your change function after all methods called.

Upvotes: 1

Related Questions