Apologies for needing help with what seems like a simple question, but I'm struggling to figure it out. I have a directive that receives data from a $broadcast event and needs to use that data 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' is being received perfectly fine, and I can confirm this through console.log. However, for some reason, it's not executing the code within:
return {
template: '<img src="../images/apple.png">'
};
I'm baffled as to why it's not working. Can anyone shed some light on this? Thanks.