【发布时间】:2015-09-14 08:11:06
【问题描述】:
在控制器中
$scope.html = $sce.trustAsHtml('This is my html');
$scope.showpopup = function(scopVar,data){
console.log(data);
}
在模板中:
<h2 ng-click ="showpopup('html',html)" ng-bind-html="html" ></h2>
我想要“showpopup”函数内的 html 范围的值(即:这是我的 html)。当我控制台时,它会像这样打印
This is my html {$$unwrapTrustedValue=function(), valueOf=function(), toString=function()}
那么我怎样才能得到实际值(即这是我的 html)?
【问题讨论】:
标签: javascript angularjs object