Sorry to ask for suck seemingly easy question, but I really don't know how to handle it and I can't make it work. I have this directive which recieves data from a $broadcast, which then has to use to create a new template.
app.directive('emptyScope', function() {
return function( $scope ) {
return $scope.$on('checkEmptyArray', function(event, data) {
return {
template: '<img src="../images/apple.png">'
};
});
}
});
The data from 'checkEmptyArray' comes in perfectly, and through console.log I can see that indeed, it recieved the data. But for some reason, it doesn't do the
return {
template: '<img src="../images/apple.png">'
};
I don't understand why it isn't doing it. Does someone have any clue? Thanks.