Is AngularJs calculation loop called after calling any function?

I have a directive that defines a function innerBarStyle()at the link stage and associates it with a scope:

restrict : 'EA',
scope: {
  values: '='             
},
link: function(scope, elements, attributes){
  scope.innerBarStyle = function(value){
    console.count("innerBarStyleCounter");
    return {
        width: 10px;
    };
  }),
templateUrl: 'template.html'
};

The function does nothing but count the number of attempts to execute and return an object.

Now, in the template-template, I call this function with an expression. Sort of<div ... ng-style=innerBarStyle(someValueInCurrentScope)><div>

, , - , . , , (, $http). . , - - ? , , , , .

+4
1

( , , ). . , , $scope. innerBarStyle, ng-style, , . Ergo - .

, , , API angular.element elem CSS.

+1

Source: https://habr.com/ru/post/1621304/


All Articles