1

In controller

$scope.html = $sce.trustAsHtml('This is my html');
$scope.showpopup = function(scopVar,data){
    console.log(data);
}

In template:

<h2 ng-click ="showpopup('html',html)" ng-bind-html="html" ></h2>

I want the value of html scope inside "showpopup" function (i.e:This is my html).When I console it,it print like this

 This is my html {$$unwrapTrustedValue=function(), valueOf=function(), toString=function()}

So how can I get the actual value( i.e This is my html)?

1 Answer 1

2
console.log($sce.getTrustedHtml(data));

Documentation can be found at https://docs.angularjs.org/api/ng/service/$sce

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.