Angular directive update template before execute controller function

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.