I have code snippet in which there is a Angular Modular Controller, but there is a function inside the same controller and with a call, which is raising doubt in my mind that is
The definition is allowed, it has the same affect as
$scope.$watch($scope.totalCart, function(){..some logic...})