As I know, in angular 1.x I can use $sce service to meet my requirment like this
myApp.filter('trustAsHTML', ['$sce', function($sce){
return function(text) {
return $sce.trustAsHtml(text);
};
}]);
and in html file use like this
{{ htmlString || trustAsHTML }}
Does there has a service like $sce or some pipe or any method can be competent to do that in angularjs 2 version?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…