A recommended way to achieve this is by emitting an event from the parent and listening to it in child controllers.
app.controller("parentctrl",function($scope){
$scope.clickfunc = function(){
$scope.$broadcast("callChildMethod",{child : 1});//1 for calling the first child method, 2 for the second child method
}
});
app.controller("childctrlone",function($scope){
$scope.childmethod= function(){
alert(1);
}
$scope.$on("callChildMethod",function(event,args){
if(args.child == 1) $scope.childMethod()
})
});
app.controller("childctrltwo",function($scope){
$scope.childmethod= function(){
alert(2);
}
$scope.$on("callChildMethod",function(event,args){
if(args.child == 2) $scope.childMethod()
})
});
Other ways (not recommended)-
Using $$childHead or $$childTail-
// works only for apps with two children in order
app.controller("parentctrl",function($scope){
$scope.clickfunc = function(){
$scope.$$childHead.childMethod();// first child
$scope.$$childHead.$$nextSibling.childMethod(); // second child
$scope.$$childTail.childMethod()// second child
$scope.$$childTail.$$previousSibling.childMethod()//first child
}
});
Using angular.element()
app.controller("parentctrl",function($scope){
$scope.clickfunc = function(){
angular.element("#idofFirstChild").scope().childMethod();// first child
angular.element("#idofSecondChild").scope().childMethod(); // second child
}
});