I'm follow this example http://jsfiddle.net/simpulton/XqDxG/, also find here http://youtu.be/1OALSkJGsRw
var myModule = angular.module('myModule', []);
myModule.factory('mySharedService', function($rootScope) {
var sharedService = {};
sharedService.message = '';
sharedService.prepForBroadcast = function(msg) {
this.message = msg;
this.broadcastItem();
};
sharedService.broadcastItem = function() {
$rootScope.$broadcast('handleBroadcast');
};
return sharedService;
});
After always getting this message
Error: Unknown provider: sharedServiceProvider <- sharedService
I just copy exactly the code of jsfiddle. My surprise. The same error. Crazy, cause at jsfiddle the code work perfectly.
Could be this code deprecated?