Issue
I have a SafeValue and need to access the internally wrapped value. Currently I do it like this:
const mySafeValue = this.sanitizer.bypassSecurityTrustStyle('42px solid black');
console.log(mySafeValue['changingThisBreaksApplicationSecurity']);
This works great but I'm pretty sure this is not how you should do it. What is the recommended way to get back a value that is wrapped as a SafeValue?
Solution
The linked answer by Powkachu was providing the correct answer. You can get the value by using the sanitizer.
const myValue = this.domSanitizer.sanitize(SecurityContext.HTML, mySafeValue)
Answered By - Felix Engelmann
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.