我有函数editPrcChallenge
我在哪里将用户路由到子状态并广播challengekey
,广播正在调用但它不在函数内部,任何想法我已经实现了错误?
到目前为止尝试过代码......
parent.js
$scope.editPrcChallenge = function (challengeKey) {
$scope.$broadcast('editPrcChallenge',challengeKey);
$state.go('app.editChallenge',{processId:$stateParams.processId,challengeKey:challengeKey});
};
child.js
$scope.$on('editPrcChallenge', function (s,challengeKey){
console.log(challengeKey);
$scope.editMode = true;
// $scope.clearFields = clearForm();
processFactory.getProcessChallengeInfo(challengeKey)
.then(function(response){
$scope.challengesDTO =response.data;
$scope.showEscalation = !!$scope.challengesDTO.challengeDesLkupCode;
});
};