I'm trying to call $rootScope.broadcast from my controller and want to listen it in the directive
Controller:
function startfunction(){
$rootScope.$broadcast('sharingFn');
}
startfunction();
Directive:
$scope.$on('sharingFn',function(){
console.log('function called");
}
but the directive is never called here, am i doing something wrong?