> > My educated guess is that in your case, you are broadcasting an event > while angular still is compiling parts of your page. >
that was _exactly_ what was happening to me -- the parents' broadcast was not being heard by the children because the children were not done instantiating yet I wrapped a promise around a dataset to make it work, but the setTimeout was written in that promise (I couldn't make the promise work without the setTimeout because it didn't call out to anything, it was just a mass of calculations.) In my case the setTimeout in the promise was enough to let the children finish their instantiation, I rationalized it by saying that javascript is single threaded and setTimeout (for now) is the only way to yield execution. I wanted to wrap the promise around the children's instantiation but could not find a list of all the .$functions that are called (or events emitted) by angular in the course of instantiation -- I was hoping to find one so that it didn't seem so coincidental that the children were done instantiating. Maybe by next time I'll know more and can build something that feels more concrete On Monday, December 1, 2014 1:59:41 AM UTC-5, Sander Elias wrote: > > Hoàng, > > I prefer to stay clear of events if possible. If your customer wants to > make sure the events are processed, you need some form of acknowledging > that the events are received. That's whole well possible, but it will come > with a pretty large fee. > The thing with events is, that you know you broadcast them, but you never > know for sure anyone is listing. > My educated guess is that in your case, you are broadcasting an event > while angular still is compiling parts of your page. That's why the timeout > works. > > Regards > Sander > > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
