我设置了一个中继器,只要里面没有html,就可以让数据显示出来。
我已经包含了angular-sanitize.js
,并尝试使用ng-bind-html
但跨度内不显示任何内容,仅在ng-bind-html
属性中显示。所以看起来消毒剂不起作用,
我读到需要将其添加到应用程序依赖项中,但不确定在哪里这样做。
我刚刚在angular网站上完成了tut,所以目前只设置了一个非常基本的控制器。
发布于 2017-12-12 20:49:16
在使用指令时遇到此问题,并且解决方案未在代码中使用"replace“。
在templateUrl视图的div上使用了‘`ng html-bind’
appDirectives.directive('helpText', [function () {
return {
restrict: 'E',
//replace: true, // With this uncommented it does not work!
scope: {
displayText: '='
},
templateUrl: '/web/form/helptext',
link: function (scope) {
}
};
}]);
https://stackoverflow.com/questions/14726938
复制相似问题