Angularjs $scope is confusing me <p>I really need some help here... I´m trying for hours now and can´t get it to work...</p> <p>I have a .json file with 100 products like this:</p> <pre><code>[{ "ean": "3613132010420", "brand": "NewBrand", "desc": "A description", "feature1": "", "feature2": "", "feature3": "", "feature4": "", "feature5": "", "img": "", "metric": { "gender": "female", }, "score":"" }, { "ean": "3613132010420", "brand": "NewBrand", "desc": "A description", "feature1": "", "feature2": "", "feature3": "", "feature4": "", "feature5": "", "img": "", "metric": { "gender": "female", }, "score":"" }] </code></pre> <p>I read the json with $http and put everything in $scope.products. The data is shown in a list, everything is fine. Now I want to filter the products and alter the score variable (after swipe on a option slider). </p> <p>The view should then also be updated due to the angular data-binding.</p> <p>How can I change this variable in the $scope? This is what I tried and nothing works:</p> <pre><code>$('.find-style-slider .slick-list').bind('touchstart click', function(){ angular.forEach($scope.products, function(value, key) { $scope.products[key].score = '25'; //nothing happens var obj = { score: '25' }; $scope.products[key].push(obj); //Uncaught TypeError: undefined is not a function $scope.products.splice(key, 0, obj); //no error but $scope variable does not change $scope.products[key].unshift(obj); //Uncaught TypeError: undefined is not a function }); }); </code></pre> <p>Do I need to update something or $apply()? I would be thankful for any help/hint...</p> <p><strong>Edit:</strong> I think the $scope is not working like I thought.... I fill the $scope.products with a service:</p> <pre><code>productService.initDb().then(function(products) { $scope.products = products; }); </code></pre> <p>When I put this </p> <pre><code> var obj = { score: '25' }; $scope.products.splice(0, 0, obj); </code></pre> <p>INSIDE the initDb function then the first elements gets updated! But not outside.</p> <p>The question is now: WHY? And how can I access the $scope.products from outside the service function?</p> <p>I thought the $scope is the same for the whole controller... <em>confused</em></p>