The controller has the following.
$rootScope.$on('progressbarEvent', function (event, data) { $rootScope.progresscurrent = data.currentprogress; console.log('Event listening: ' + $rootScope.progresscurrent); }); I have this in a factory service. $rootScope.$emit('progressbarEvent', dataFactory.currentprogress);
$ on returns undefined. Does anyone know the reason for this?
My controller:
app.controller('indexcontroller', ['$rootScope','$scope', '$http', 'dataFactory', function ($scope,$http,$rootScope, dataFactory) {
angularjs angularjs-scope
Keith
source share