I am trying to set the IFrame Source Input with a component below.
Its not working for some reason, showing no wepages. How can I set the input source properly?
Calling Method:
<app-viewer-iframe-two
[url1]="'http://www.food.com'"
[url2]="'http://www.car.com'"
>
</app-viewer-iframe-two>
Typescript:
export class ViewerIframeTwoComponent implements OnInit {
constructor() { }
@Input() url1: string;
@Input() url2: string;
ngOnInit(): void {
}
}
HTML:
<div class="box">
<iframe class="iframe-one" src="{{url1}}" frameborder="0"
scrolling="yes" align="left"> </iframe>
</div>
<div class="box">
<iframe class="iframe-two" src="{{url1}}" frameborder="0"
scrolling="yes" align="right"></iframe>
</div>
Error:
No source ever gets set,
Resource: this is only for Angular 1
How to set an iframe src attribute from a variable in AngularJS