title: Angularjs function inside ng-repeat called too many times
body: <p>I've got a function in my controller very easy that just stamp a console.log. I need to conditioning a button using a function but inside the ng-repeat the controller repeats everything many times! Is it normal? Is it possible avoid this? Thanks. An example here <a href="http://plnkr.co/edit/sME67gQEZQSLI9FOwEAG?p=preview" rel="nofollow">http://plnkr.co/edit/sME67gQEZQSLI9FOwEAG?p=preview</a></p>
  
  <p>relative code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
    &lt;head&gt;
      &lt;script data-require="angular.js@1.4.5" data-semver="1.4.5" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" href="style.css" /&gt;
      &lt;script src="script.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
  
    &lt;body ng-app="DigestApp"&gt;
      &lt;div ng-controller="UserCtrl as uc"&gt;
        &lt;h1&gt;Please open the console to see&lt;/h1&gt;
        &lt;ul&gt;
          &lt;li ng-repeat="user in uc.users" ng-class="uc.userClasses(user)"&gt;
            {{user.name}}
            &lt;button ng-if="uc.isUserEnabled(user)"
                    ng-click="uc.disableUser(user)"&gt;Disable&lt;/button&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>javascript:</p>
  
  <pre><code>angular.module("DigestApp", [])
  
  .controller('UserCtrl', function(User) {
    var vm = this;
  
    vm.users = User.list();
  
    vm.isUserEnabled = function(user) {
      console.log('isUserEnabled');
      return user.active;
    };
  
    vm.userClasses = function(user) {
      console.log('userClasses');
      return []
        .concat(user.active ? ['user-active'] : [])
        .concat(user.loggedIn ? ['user-logged-in'] : [])
        .concat(user.isMe ? ['user-is-me'] : [])
        .join(' ');
    };
  
    vm.disableUser = function(user) {
      user.active = false;
    };
  })
  
  .factory('User', function() {
    return {
      list: function() {
        return [{
          name: "me",
          active: true,
          loggedIn: true,
          isMe: true
        }];
      }
    };
  });
  </code></pre>