I have a controller/services etc defined like the below as an example:
function IndexController($scope, shoppingItems) {
$scope.items = shoppingItems;
}
I then wondered whether all my JS should be proteted from the global namespace like so:
(function() {
function IndexController($scope, shoppingItems) {
$scope.items = shoppingItems;
}
});
My app no longer works, can you explain if I need to do this or not and if so how to get it working.
Thanks
I suggest you use the new style of registering controllers(at least as of
1.0.3, might be1.0.1as well)