0

I am trying to get ng-src to work in an iframe, but I can't seem to figure it out. Is it possible?

<div class="row" ng-init="video='http://www.youtube.com/embed/gMW8jUX14Y0'">
  <div class="col-md-12">
    <!-- 16:9 aspect ratio -->
    <div class="embed-responsive embed-responsive-16by9">
      <iframe class="embed-responsive-item" ng-src="{{ video }}"></iframe>
    </div>     
  </div>
</div>

The page loads a blank iframe and it never refreshes. on the same page I can include this code and it works just fine.

<a ng-href="{{ video }}">Link</a>
0

1 Answer 1

2

iframe and ng-src have been discussed on SO before with a solution using $sce (to trust the URL for ng-src='URL')
link: AngularJS ng-src inside of iframe
link: Unable to load url into iframe via AngularJS controller
link: How to set an iframe src attribute from a variable in AngularJS

GL!

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.