I need to get a value of strings in a hidden div from inside an angular app. Here is what I have:
<iframe id="sample">
<html>
<head></head>
<body>
<div id="testString" display="none;">string </div>
<app></app>
</body>
</html>
</iframe>
How can I access the value of div testString
inside the Angular app in non root component?
tried with these and get null:
window.parent.document.getElementById('testString').textContent
document.getElementById('testString').textContent
Can it be done with ElementRef? Also how can I secure this string against injection and xss attacks?
Thanks