title: angularjs computed property not updating after model changes
body: <p>I have a simple activity viewer in a table that lists activities and their statuses (read or not read) from a db. On the page is a counter that shows how many activities are unread. Each activity gives the option to <code>mark read</code> or <code>mark unread</code> depending on the condition. For some reason after the <code>model</code> is being updated the computed value is not changing on the counter.</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>function Activity($scope, $http, $templateCache)
  {
      $http.get('/activity/get').success(function(data, status)
      {
          $scope.activities = data;
      });
  
      $scope.totalActivities = function()
      {
          var count = 0;
  
          angular.forEach($scope.activities, function(activity)
          {
              count += activity.seen == 0 ? 1 : 0;
          });
  
          return count;
      }
  
      $scope.updateActivity = function(activity)
      {
          activity.seen = activity.seen == 0 ? 1 : 0;
  
          $http({
              method: 'PUT',
              url:    '/activity/' + activity.id,
              data:   { seen: activity.seen }
          })
          .success(function(data, status)
          {
              console.log(data);
          });
      }
  }
  </code></pre>
  
  <p><strong>Counter</strong></p>
  
  <pre><code>&lt;span class="badge badge-alert"&gt;{{ totalActivities() }}&lt;/span&gt;
  </code></pre>
  
  <p><strong>Table row + button</strong></p>
  
  <pre><code>&lt;tr ng-repeat="activity in activities" ng-class="{ 'activity-read': activity.seen == 1 }"&gt; 
      &lt;td&gt;
          &lt;button class="btn btn-default" ng-click="updateActivity(activity)"&gt;&lt;span&gt;@{{ 0 == activity.seen ? 'Mark Read' : 'Mark Unread' }}&lt;/span&gt;&lt;/button&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p><strong>nav template (separate code block)</strong></p>
  
  <pre><code>&lt;div class="account-details" ng-controller="Activity"&gt;
      @if (Sentry::hasAccess('admin'))
      &lt;a href="{{ route('activity.index') }}" class="activity pull-left"&gt;
              &lt;span class="badge badge-alert"&gt;@{{ totalActivities() }}&lt;/span&gt;
          &lt;/a&gt;
      @endif
  &lt;/div&gt;
  </code></pre>
  
  <p>The counter works fine when first loaded but any updates to the model need a page refresh for the new calculation to show.</p>