title: Can't bind data to view angularjs
body: <p>I’ve got some problem with binding my data to my view with angularjs in the ionic framework.</p>
  
  <p><strong>This is my controller.js:</strong></p>
  
  <pre><code>.controller('InventoryCtrl', function($scope, Category, Inventory) {
  $scope.categories = Category;
  
  
  $scope.searchInventory = function(category){
  var word = category.Category;
  
  var ref = new Firebase('https://vivid-heat-2430.firebaseio.com/');
  
  var invenRef = ref.child('Inventories');
  var prodRef = invenRef.child('Products');
  
  
  invenRef.orderByChild("Products").on("child_added", function(snapshot) {
    var data = snapshot.val();
    var store = data.Inventory;
    var prod = data.Products;
    var test = Object.keys(prod);    
  
    for( var i = 0; i &lt; test.length; i++){
      if (test[i] == word) {
        console.log(test[i]);
        console.log("Storage place: " + data.Inventory + " Datum inventaris: " + data.Date);
        $scope.show= test[i];
  
      };
  
    };
  
  });
  
  };
  })
  </code></pre>
  
  <p>Here I’m getting my products from my array. Then I’m comparing it. It will give me the matching objects and it will also give me the storage place where it belongs to. I can log this in my console. But when I’m trying to bind it to my view. It gives me nothing. </p>
  
  <p><strong>this is my index.html:</strong></p>
  
  <pre><code>&lt;ion-content&gt;
      &lt;p&gt;&lt;b&gt;Zoek categorie&lt;/b&gt;&lt;/p&gt;
    &lt;ion-scroll direction="y" &gt;
      &lt;div style="max-height: 300px" ng-controller="InventoryCtrl"&gt;
        &lt;ion-list&gt;
          &lt;ion-radio ng-repeat="category in categories" class="item-accordion" ng-model="checked.check" value="{{category.Category}}" ng-click="searchInventory(category)"&gt;
            &lt;p&gt;{{category.Category}}&lt;/p&gt;
          &lt;/ion-radio&gt;
          &lt;br&gt;
        &lt;/ion-list&gt;
      &lt;/div&gt;
  
      &lt;div&gt;
          &lt;ion-list&gt;
              &lt;ion-item&gt;
                {{show}}                  
              &lt;/ion-item&gt;
          &lt;/ion-list&gt;
        &lt;/div&gt;
    &lt;/ion-scroll&gt;
    &lt;/ion-content&gt;
  </code></pre>
  
  <p>And I don’t understand what I did wrong… Is it because my <code>$scope.show</code> is still inside the  <code>.on</code> method?</p>