Showing posts with label Broadcast for angularjs. Show all posts
Showing posts with label Broadcast for angularjs. Show all posts

Monday, December 28, 2015

How to get the parent controller value using in angularjs

Hi viewers,

Parent Controller

$username ="xxxxxxxxxxxxx";

$rootScope.$broadcast("parentValue", $username);

Child Controller 

$scope.childValue = $scope.$on('parentValue');

console.log($scope.childValue);