change from function controller to module controller problem
Hi, I'm fairly new to this lib, and in app.js I was trying to change from:
function MainCtrl($scope, $routeSegment, loader) { $scope.$routeSegment = $routeSegment; $scope.loader = loader; $scope.$on('routeSegmentChange', function() { loader.show = false; }) }
to:
app.controller('MainCtrl', ['$scope', '$routeSegment', 'loader', function($scope, $routeSegment, loader) { $scope.$routeSegment = $routeSegment; $scope.loader = loader; $scope.$on('routeSegmentChange', function() { loader.show = false; }) }]);
however, it doesn't seems working, can you help me look at the code and tell me where I did wrong? I've been googling and looking at documentations but no luck... Thanks!
Have you tried $scope.$apply() yet?