I'm unable to pass the URL to an iframe dynamically. I checked several sources on the Internet, but none of them worked properly.
File my-component.component.html
<iframe
width="100%"
height="100%"
src="{{ dynamicUrl }}"
scrolling="auto"
></iframe>
File my-component.component.ts
import { Component, OnInit } from '@angular/core';
@Component({
...
})
export class MyComponent implements OnInit {
dynamicUrl =
'https://some-website.com/app/main/dashboards/63a0846ut7gxn0035c049e4?embed=true';
constructor() {}
ngOnInit(): void {}
}
The frame is not loading and in console I'm getting this error:
core.mjs:7635 ERROR Error: NG0904: unsafe value used in a resource URL context
What’s the best approach?