I have a directive which i am using to highlight code (syntax highlighting). Sometimes this text contains curly braces and angular tries to bind them. How can i disable that binding :
app.directive('highlightJs', ['$timeout',function ($timeout) {
return {
restrict: 'AE',
link : function (scope,elem,$scope) {
$timeout(function(){
var x=elem[0].innerHTML;
elem[0].innerHTML='<pre><code>'+x+'</code></pre>';
console.log(x);
hljs.highlightBlock(elem[0]);
},0);
}
};
Use example:
<highlight-js>
<img ng-src='{{url}}'/>
<highlight-js>
renders as <img ng-src=""/>
and not <img ng-src="{{url}}"/>
Any help would be great.