I am facing an issue with broadcasting an array of albums to another controller. In the structure of my controllers, I have a parent controller called multimediaController and a child controller named multimediaAlbumController. Although I am sending a variable, I cannot seem to receive it for some unknown reason.
multimediaController.ts
export class MultimediaController {
$scope;
static $inject = ['$scope'];
constructor($scope){
this.$scope = $scope;
}
changeAlbum(){
this.$scope.$broadcast('prod', console.log("sending") );
}
}
multimediaAlbumController.ts
export class MultimediaAlbumController{
$scope;
static $inject = ['$scope'];
constructor($scope){
this.$scope = $scope;
}
brodRec(){
this.$scope.$on('prod', () => {
console.log("receiving");
});
}
}
Even though in the console I see "sending" being logged, I am unable to get the message "receiving". What could be the mistake that I am making?