0

I am brand new to Angular so this question is difficult to ask and describe.

The last stack overflow question posted regarding writing HTML to a page with Angular JS was posted over two years ago and I have not been able to get it to work.

Basically, I am trying to write the HTML for an IFrame that is stored in a variable in the HomeController to a view.

I am trying to use angular-sanitize.min.js.

//The Code Inside the HomeController

$scope.AudioPlayer = '<iframe width="100%" height="300" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/47990402&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true"></iframe>';

// On HTML View Page This Code Has Been Added

<div class="SongPlayer" ng-bind-html="AudioPlayer"></div>

All of the other variables passed into the HTML view load correctly within the {{templating}} tags.

user1769348
  • 21
  • 1
  • 3
  • Would you please be more clear ? you may provide a plunkr if you wish – katmanco Nov 06 '14 at 17:47
  • I just updated the question to try to make it more clear. I am brand new to Angular, so this question is difficult to ask and describe. – user1769348 Nov 06 '14 at 18:03
  • I just answered a similar question today: http://stackoverflow.com/questions/26781835/preserving-line-breaks-in-angularjs/26781942#26781942 The bottom line is that you have to use $sce before binding HTML code to an element. – Shomz Nov 06 '14 at 18:04

0 Answers0