The 0 isn't necessary, and using $timeout to defer some action isn't an antipattern, but the rest of your message concerns me. If you're communicating between controllers using $scope, you're doing it wrong. Make a service if two controllers need to share state.
On Thu, May 1, 2014 at 4:04 PM, Billy Figueroa <[email protected]> wrote: > Is is bad practice to use $timeout with a time of 0? > > i.e. > $timeout(function() { > // some action here > }, 0); > > I find that sometimes data doesn't load in a child controller and I may > want to use this. I have avoided using it, but what are peoples experience > with this? > > > -- > 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. > -- chrisrhoden -- 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.
