$watch
only evaluate string or function parameter in its first argument. Change your $watch
like this :
$scope.$watch('cart.name + cart.id + cart.amount', $scope.updateCart());
OR
$scope.$watch('cart', $scope.updateCart, true);
See reference API
More Related Contents:
- AngularJS : How to watch service variables?
- How to deep watch an array in angularjs?
- What is the Angular equivalent to an AngularJS $watch?
- Is it feasible for a start-up of two developers to do full automated regression testing without manual testing? [closed]
- Why don’t the AngularJS docs use a dot in the model directive?
- If you are not using a .(dot) in your AngularJS models you are doing it wrong?
- AngularJS For Loop with Numbers & Ranges
- AngularJS-Twig conflict with double curly braces
- AngularJS – Create a directive that uses ng-model
- How to count total number of watches on a page?
- AngularJS ng-class if-else expression
- Cordova + Angularjs + Device Ready
- No ‘Access-Control-Allow-Origin’ header is present on the requested resource- AngularJS
- Chaining Ajax calls in AngularJs
- Why angularjs will invoke function `name()` twice?
- AngularJS : ng-repeat filter when value is greater than
- Difference between ui-sref and $state.go in AngularJS UI-Router
- AngularJS intellisense not working on Visual Studio 2015
- How would I have ui-router go to an external link, such as google.com?
- How to highlight a current menu item?
- AngularJS All slashes in URL changed to %2F
- Error : getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
- Lazy loading AngularJS modules with RequireJS
- ng-options with simple array init
- stop angular-ui-router navigation until promise is resolved
- How to set the value attribute for select options?
- AngularJS: How to nest applications within an angular app
- $sce.trustAsResourceUrl() globally
- How do I filter an array with AngularJS and use a property of the filtered object as the ng-model attribute?
- Auto logout with Angularjs based on idle user