据我所知,在角度1.x中,我可以使用$ sce服务来满足我的要求
myApp.filter('trustAsHTML', ['$sce', function($sce){
return function(text) {
return $sce.trustAsHtml(text);
};
}]);
Run Code Online (Sandbox Code Playgroud)
并在html文件中使用这样的
{{ htmlString || trustAsHTML }}
Run Code Online (Sandbox Code Playgroud)
是否有像$ sce或某些管道的服务或任何方法可以胜任在angularjs 2版本中做到这一点?