This is the view code:
<a type="button" ui-sref="index.usermng.userInfo" ng-click="checkUserInfo(item.id)" class="btn btn-primary">check</a>
Controller:
//UserManage Controller
userApp.controller('userCtrl', ['$scope', '$http', '$location', 'serverUrl', function($scope, $http,
$scope.checkUserInfo = function(userId) {
console.log(userId);//I can get userId in here
$scope.$broadcast('toUserInfo',userId);
}
}]);
//UsrInfo Controller
userApp.controller('userInfoCtrl', ['$scope', '$http', 'serverUrl', function($scope, $http, serverUrl) {
$scope.$on('toUserInfo',function(data){
console.log("in.....");
console.log(data);
})
How to get the 'userId' from 'userCtrl' in 'userInfoCtrl'?