Is it possible for a child $scope (isolated or not) to execute $scope.$apply without applying a patent scope?
Expensive calculation happens in the parent area (it's hard to cache), and I don't need angular to run the calculation again.
eg:
<div ng-controller="ParentController"> {{ expensiveFunction() }} <div directive> <h1 ng-click="applyChildScopeOnly()">Click {{ value }}</h1> </div> <div directive> <h1 ng-click="applyChildScopeOnly()">Click {{ value }}</h1> </div> <button ng-click="applyChildrenScope()"/> </div>
Directive:
module.directive('directive', ['$document','$rootScope', function ($document,$rootScope) { return{ restrict:'AE', scope:{}, link:function($scope, element, attrs){ $scope.applyChildScopeOnly = function(){ $scope.$apply();
g00fy source share