Ng-if with includes method in template node?

Hello everyone,

I have an array of objects that have URL properties, with values that contain or

I'm trying to present them as either an Image or a Embedded Video depending on their src.
What am I doing wrong here?

  <div class="chime-img-wrap">
     <img ng-if="" src="{{}}" alt="" class="chime-img" >
     <iframe ng-if=""  src="{{}}" class="chime-vid" width="320" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

I think i was encountering a cors issue when trying to dynamical construct an embedded youtube video because I couldn't ever get the thing to load even though i'm sure I had the html and properties and values correct.
I opted to just handle .mp3, .mp4, .png, & .gif media urls instead.
I used my .includes() method in a prior function node on the appropriate properties then passed them along to my template node that looked like (note this next code segment is inside a ng-repeating div)

  <div class="chime-img-wrap" ng-if="obj.isgif === true">
     <img src="{{}}" alt="" class="chime-img" >
  <div class="chime-img-wrap" ng-if="obj.ispng === true">
     <img src="{{}}" alt="" class="chime-img" >
  <div class="chime-img-wrap" ng-if="obj.ismp4 === true">
    <video width="320" height="240" controls>
     <source src="{{}}" type="video/mp4">
  <div class="chime-img-wrap" ng-if="obj.ismp3 === true">
    <audio controls>
     <source src="{{}}" type="audio/mp3">

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.