sample:
father:
$scope.gotoTap = function(tapIndex)
{
//broadcast checkCalculate event to child control
$scope.$broadcast("checkCalculate", tapIndex);
}
$scope.$on('calcuRs', function(event,tapIndex)
{
console.log("switch tap to index--> "+tapIndex);
if(!$scope.isNull(tapIndex)&&(!isNaN(tapIndex)))
{
$state.go('app.customers.detail.quote.steps.quotePlan.plan'+tapIndex);
}else
{
console.log('tapIndex is null,can not switch tap~!');
}
});
child:
$scope.$on('checkCalculate', function(event,tapIndex)
{
toastrShow.syserror("hhahahhha");
$scope.$emit('calcuRs',tapIndex);
});