One work around is using $scope.$apply() like this article suggests. For me, that was a pretty quick solution, with minimal code changes.
Another idea is avoiding shared pirimitive variables directly on $scope, put it in a map-like object instead. My suggestion for naming that is $scope.scopeNoReallyShareThisScope... but I'm feeling especially cynical about angular.js at the moment. A giant forest of hard-to-monitor scope-based couplings between DOM and code is no way to live.
No comments:
Post a Comment