based on this reply link I tried to send a data when I click on a button and call a method from Controller1 to Controller2 this is my try:
Controller1:
$scope.DetailsLivraison = function(){
var idv = $scope.idBonSortie;
$rootScope.$emit("CallParentMethod", idv);
}
Controller2:
$rootScope.$on("CallParentMethod", function(){
$scope.parentmethod(idv);
});
$scope.parentmethod = function(idv) {
//Data traitment
}
my problem is that,the method in the second controller is not called,I have defined $rootscope in both controllers any help please to solve the problem thanks for help