Perhaps delegating to a service will make it less odd. Raul
Sent from my iPhone > On Dec 12, 2014, at 6:45 PM, Eric Eslinger <[email protected]> wrote: > > It's more just odd - I am working on converting to using the 'controller as' > syntax, which mostly does away with directly addressing $scope, but that's > apparently still needed when I do something that updates the scope from > outside the angular event cycle. > > In particular, my datamodel gets events from a websocket occasionally, at > which point I need to update the data in the model and then kick off a digest > cycle, otherwise the page doesn't repaint the changed data. It's not > difficult, just struck me as odd that I still needed to inject $scope. > > e > >> On Fri Dec 12 2014 at 3:24:54 PM Raul Vieira <[email protected]> wrote: >> I don't know of any other option to get the view updates. The only choices >> to make would be to apply at the current scope vs the root level or moving >> the apply into a service. The latter would require the rootscope (I know >> you know that already:)). >> >> Are you doubting the behavior using the new syntax? >> >> Sent from my iPhone >> >>> On Dec 12, 2014, at 3:55 PM, Kirru <[email protected]> wrote: >>> >>> yes.. you can call it by just injecting $scope. >>> >>> Thanks >>> K >>> >>>> On Friday, 12 December 2014 15:48:31 UTC-5, Eric Eslinger wrote: >>>> Hey List, >>>> >>>> I'm trying to call $scope.$apply (because I am getting data into my model >>>> outside the angular lifecycle) in a controller that is using the newer >>>> 'controller as' syntax. Should I just inject $scope and call $scope.$apply >>>> as usual? >>>> >>>> e >>> >>> -- >>> 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. >> >> -- >> 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. > > -- > 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. -- 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.
