I\'m implementing a shopping cart and want to store the data in localStorage. I want to watch the variable $scope.cart for change so that I can update the local
$scope.cart
$watch only evaluate string or function parameter in its first argument. Change your $watch like this :
$watch
$scope.$watch('cart.name + cart.id + cart.amount', $scope.updateCart());
OR
$scope.$watch('cart', $scope.updateCart, true);
See reference API