Angular directive update template before execute controller function

Posted by itungnt on Tuesday, November 22, 2016

Some time you want to response to user before you execute heavy task.

There is one way is to use broadcast and listener.

Today I use another way. I use the other variable for the directive template and other for the logic in controller.

I update the `flagSrc` then use timeout to call controller function. So the `flagSrc` will be update when the scope apply and the controller function will be called in another thread.


comments powered by Disqus