我决定不使用新的指令,而是决定使用2个过滤器:
App.filter('newlines', function () { return function(text) { return text.replace(/n/g, '<br/>'); }}).filter('noHTML', function () { return function(text) { return text .replace(/&/g, '&') .replace(/>/g, '>') .replace(/</g, '<'); }});然后,在我看来,我将一个管道插入另一个管道:
<span ng-bind-html-unsafe="dataFromModel | noHTML | newlines"></span>



