I want to use iframes from youtube and other similar platforms - but I can't find out how to use a variable as my source.
I've searched for it already, but the answers I got didn't work out.
So here is the iframe:
<div class="right">
<h2>Associated Pictures/Media Files</h2>
<p>Here we will display either Infos, Fotos, Videos, Music or even interative content.</p>
<div style="padding: 2%;">
<iframe
width="100%"
height="315"
src="https://www.youtube.com/embed/Q7hmXN714RQ"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
</div>
</div>
the only thing I want is to use this variable here:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
source = 'https://www.youtube.com/embed/Q7hmXN714RQ';
}
But when I try to do it in various ways - like for example:
src="{{source}}"
this doesn't work at all :(
Does anyone know how to do this right? I cannot find a proper solution for this problem.