I took out the setTimeouts and the code doesn't work -- the children are not yet ready to listen. I think you need the timeouts to yield the thread (that's my old c++ talkin')
The two-way binding is working fine, but that's irrelevant in this case. Normally I am pulling my data via ajax, which promises just fine - but this problem shows up when I don't have access to the server and I have to promise locally stored data. thanks for the ideas On Sunday, November 23, 2014 8:02:28 PM UTC-5, Eric Eslinger wrote: > > All promise resolves (e.g., then() and catch()) end up getting resolved > asynchronously. Even promises that don't themselves do anything > asynchronous (as in, they return a value rather than a promise to a value) > end up executing asynchronously, as I understand the code. > > However, angular is already pretty good at two-way data binding. You can > do a $scope.$watch in the child controller to look for updates on the data > if it's in a known location. So if the child has a $watch on the data > itself, it'll get notified when the data changes. On the other hand, if > the directives actually displaying the data are correctly angularized, they > should re-flow themselves if the data that drives their layout changes > (e.g., you don't have to broadcast events at all to add rows to a table if > you're using ng-repeat). > > On Sun Nov 23 2014 at 10:12:10 AM Al J <[email protected] <javascript:>> > wrote: > >> ok, >>> >> >> I learned how to write a promise to make this work >> >> but that promise has an embedded setTimeout() since it doesn't depend on >> any .ajax or something else that generates a promise >> >> is setTimeout the only way (for now) to yield() ? >> >> I understand that when EC6 gets here we'll have a yield keyword >> >> does that mean that _all_ promises, at some level, do a setTimeout ? >> >> >> -- >> 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] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at http://groups.google.com/group/angular. >> For more options, visit https://groups.google.com/d/optout. >> > -- 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.
