javascript - Waiting for a promise to be resolved in a different controller -


I am struggling for the AngularJS, unless a promise has been made, do not attempt to get the delayed code Will be done.

I am being promised and executed in Controller A, but to promise Controller B, I need a piece of code from Controller B until the promise from Controller A is completed.

I am doing $ scope Hacks of some kind with $ Watch , but I'm sure there should be another different way to accomplish this.

Am I wrong?

Thanks in advance!

My promise is called in Controller A and is being executed, but I need it to promise Controller B For a piece of code from Controller B, the promise from Controller A will not be fully resolved.

In this case I $ rootScope $ Broadcast .

A controller sends broadcast messages to another controller ( or who listens )


Comments