I have a specific scenario where I am dealing with a list populated using ng-repeat. In this setup, I also have a directive that handles formatting based on the content type field. My objective is to implement directives on the injected HTML. Is there a way to achieve this? The issue I am facing is related to the second statement within the if statement, specifically with ng-bind. Here is the code snippet I am working with:
angular.module('mobileDashboardApp')
.directive('detailFormat', function () {
return {
link: function postLink(scope, element, attrs) {
var entry = scope.entry;
if(entry.type === 'action') {
element.append('<button>' + entry.value + '</button>');
} else if (entry.type === 'event') {
element.append('<button ng-bind="entry.value"></button>');
} else if(entry.type === 'comment') {
element.append('<strong>Note:</strong> ' + entry.value);
}
}
};
});