【发布时间】:2016-02-02 00:32:03
【问题描述】:
据我所知,在 Angular 1.x 中,我可以像这样使用 $sce 服务来满足我的要求
myApp.filter('trustAsHTML', ['$sce', function($sce){
return function(text) {
return $sce.trustAsHtml(text);
};
}]);
在html文件中这样使用
{{ htmlString || trustAsHTML }}
在 angularjs 2 版本中是否有像 $sce 或一些管道或任何方法可以胜任的服务?
【问题讨论】: