|Re: [angular.js] view not updating on $scope.modelName = someValue;||Suller Andras||6/9/12 9:52 PM|
Is looks like $scope.$apply solves the issue:
On Sun, Jun 10, 2012 at 10:47 AM, Joel Holdbrooks
> I've spent a bit of time trying to figure this one out, I'm hoping someone
> out there can help clue me in to whats missing.
> Here's the fiddle:
> Basically I have a directive (snippet), a service (tokenService), a
> controller (TokenCtrl), and some code which has been run through CodeRay (a
> syntax highlighter). Whenever someone clicks on one of the "tokens" in the
> code (ie. a span) I would like to see the name of the token displayed. I'm
> trying to figure out why the binding tokenName doesn't update in the view
> when it's changed. If you open the console, it shows everything is working
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To view this discussion on the web visit
> To post to this group, send email to ang...@googlegroups.com.
> To unsubscribe from this group, send email to
> For more options, visit this group at
|Re: [angular.js] view not updating on $scope.modelName = someValue;||Dan Doyon||6/9/12 10:19 PM|
I came up with a slightly different way but essentially the same
On Jun 9, 2012, at 10:08 PM, Joel Holdbrooks wrote:
Thanks so much! I really appreciate the help! To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/vig6azFWWzsJ.
|Re: [angular.js] view not updating on $scope.modelName = someValue;||Igor Minar||6/19/12 1:17 PM|
I looked at this and I actually think that you are not thinking about the solution correctly.
Forget events, in angular scope events should be used only in very special cases when data-binding is not suitable.
Instead, embrace data-binding whenever possible: http://jsfiddle.net/IgorMinar/zw6dw/8/
On Sun, Jun 10, 2012 at 8:28 PM, Joel Holdbrooks <cjhold...@gmail.com> wrote:
Ah, very nice. I like this approach as well. There's so much packed in to angular, it's nice to have such a helpful community, thanks! To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/r46aA4jM1t4J.
|Re: [angular.js] view not updating on $scope.modelName = someValue;||Dan Doyon||6/19/12 1:30 PM|
|Re: [angular.js] Re: view not updating on $scope.modelName = someValue;||Vojta Jína||6/30/12 5:38 PM|
$$phase is either '$apply' or '$digest' or null
So yep, if (!scope.$$phase) scope.$apply() will work. Although, it's highly recommended to to not have code being executed sometimes within apply and sometimes outside.
On Thu, Jun 21, 2012 at 10:10 PM, ItsLeeOwen <l...@coderebelbase.com> wrote:
Sorry typo, I believe you should only run a digest if $scope.$$phase is false. if( !$scope.$$phase ). I'll double check later.To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/PFqGqhiudccJ.