angularjs - angular.js boradcast error: $rootScope.broadcast is not a function -
i adding items dynamically array of items , let directive know there new items. inside controller function additem() trying following:
settimeout(function(){ $rootscope.broadcast("itemadded"); // tried: $scope.broadcast("itemadded"); isn't working });
problem: i'm getting error:
$rootscope.broadcast not function
any clues? happy post more code if need more information.
its typo :
$rootscope.$broadcast(name, args)