I want this piece of code
<test data="myObject"></test>
to be rendered as
<p>raw html code that is stored inside myObject.html</p>
My directive
module.directive('test', function() {
return {
restrict: 'E',
template: '<p ng-bind-html="__what_to_do_here__?"></p>',
scope: {
// This object has a html propery which contains raw html.
data: '='
}
};
});
How can i pass the raw html variable to the ngBindHtml directive in my template?
ng-bind-html="data.html"- does that work?