How to pass variable in iframe?

Hi everyone, I want to display a video with an iframe but I don’t know how to get the url from my ts.
What is the good syntax to pass the vines.embed_url in the src ?
This is my code below:


Thanks !!

Hi, @mexraccoon,

you just need to change css of your is reference code.

<ion-card class="card">
      / / YOUR HEADER
       // YOUR CONTENT

and then put css like this.

        position: absolute;
        top: 20px;

And remove your iframe from ion-card.

But I need my iframe to be in the ion-car to get the value from my ngFor
It’s just I don’t succeed to pass variable in the iframe’s src=""
Do you know the syntax?


maybe property binding instead interpolation works


Best regards, anna-liebt

Have you checked the debugger?

I imagine there is a message talking about SafeResoureURL or something similar. If this is the case, read up on DOM sanitization using Angular’s DOMsanitizer

If you are going to use property binding, src should look like [src].

Hi thanks for your replies,
I have finally suceeed in using DomSanitizer to secure the url

    return this.dom.bypassSecurityTrustResourceUrl(vid);
1 Like

Wonderful! Glad I could help.

Hi, I’m having same issue here… can u help me with the solution?