angularjs中使用$http服务获得一个完整的HTML代码,我本意是想让这代码显示的,结果却存在浏览器中没显示,求告知怎么解决?
怪我咯2017-04-17 16:20:53
In Angular, by default, assigning HTML directly to a variable and then displaying it is not trusted.
At this time, we have to use $sce.trustAsHtml(value); to tell angular that this is trustworthy.
For example:
$scope.loginHtml = $sce.trustAsHtml("<h1>login.html</h1>");
$sce also provides other methods, such as trustAsUrl, trustAsJs, etc.