angular.module('myApp', []).controller('MainController',
['helloDude','$scope', function($rootScope,helloDude) {
$rootScope.$on("$routeChangeStart", ['$scope',function() {
var sss=helloDude.user();
console.log("In main controller and event is fired"+sss);
alert("Event is fired");
}]);
}]);
angular.module('hellService',[]).service('helloDude', function() {
// var user= function(){
return "hello";
alert("in service");
// };
});
ERROR:Error: [$injector:unpr]
http://errors.angularjs.org/1.2.26/$injector/unpr?p0=helloDudeProvider%20%3C-%20helloDude
http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js
Line 6
*OR*
ERROR:Rd/this.$get</<()angular.min.js (line 68)
a =
Error: [$injector:unpr]
http://errors.angularjs.org/1.2.26/$injector/unpr?p0=helloDudeProvider%20%3C-%20helloDude
...p"+(c-1)+"="+encodeURIComponent("function"==typeof
arguments[c]?arguments[c].toS...
c = undefined
Zd/this.$get</k.prototype.$apply()
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.