title: $scope.$on only works on first view
body: <p>I'm new to AngularJS, but have run into a problem with my Ionic app. On one of my views I'm using ng-repeat to show the values from a pouchDB. However, it only works the first time I view it. If I navigate away from the view and then back it is just blank. I believe I have identified the problem to be part of the code in my controller.</p>
  
  <p>My view:</p>
  
  <pre><code>&lt;ion-view title="All"&gt;
    &lt;ion-content padding="true"&gt;
      &lt;div class="list" ng-controller="MyController"&gt;
        &lt;div class="item item-button-right" ng-repeat="name in names"&gt;
        {{name.name}} 
        &lt;button class="button button-clear button-assertive" ng-click="addFav(name.name)"&gt;
        &lt;i class="icon ion-ios-heart-outline"&gt;&lt;/i&gt;
        &lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;      
    &lt;/ion-content&gt;
  &lt;/ion-view&gt;
  </code></pre>
  
  <p>My Controller:</p>
  
  <pre><code>app.controller("MyController", function($scope, $ionicPopup, PouchDBListener) {
    $scope.names = [];
  
    $scope.addFav = function(favName) {     
        $ionicPopup.alert({
            title: 'Favorite',
            template: favName + ' has been added',
            okText: 'OK'
        })
    }
  
    $scope.$on('add', function(event, name) {
        $scope.names.push(name);
    });
  });
  </code></pre>
  
  <p>It seems that the $scope.$on is only run on the first view and thereby causing the view to be blank. Being new, I got the above code from a tutorial and therefore don't really have any ideas on what is causing it or how to fix it?</p>
  
  <p>UPDATE:</p>
  
  <p>I have a broadcast in my factory that syncs my DB:</p>
  
  <pre><code>app.factory('PouchDBListener', ['$rootScope', function($rootScope) {
  
  localDB.changes({
      continuous: true,
      onChange: function(change) {
          if (!change.deleted) {
              $rootScope.$apply(function() {
                  localDB.get(change.id, function(err, doc) {
                      $rootScope.$apply(function() {
                          if (err) console.log(err);
                          $rootScope.$broadcast('add', doc);
                      })
                  });
              })
          } else {
              $rootScope.$apply(function() {
                  $rootScope.$broadcast('delete', change.id);
              });
          }
      }
  });
  
  return true;
   }]);
  </code></pre>
  
  <p>Do I need a broadcast in my controller as well?</p>