Created
January 25, 2017 15:56
-
-
Save bora89/53def0e860319ec61d93028aa39ce0f6 to your computer and use it in GitHub Desktop.
Angular SCE, untrusted URL
From http://stackoverflow.com/questions/21292114/external-resource-not-being-loaded-by-angularjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module('plunker', ['ngSanitize']); | |
app.controller('MainCtrl', function($scope, $sce) { | |
$scope.trustSrc = function(src) { | |
return $sce.trustAsResourceUrl(src); | |
} | |
$scope.movie = {src:"http://www.youtube.com/embed/Lx7ycjC8qjE", title:"Egghead.io AngularJS Binding"}; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class="youtube-player" type="text/html" width="640" height="385" ng-src="{{trustSrc(movie.src)}}" allowfullscreen frameborder="0"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment