This is common problem. Some of the JS stuff does not mix well with angular. What I often do is that I add "extension" methods to a JS file.
1) Write a directive which is wrapper around a Youtube API(you need to override onYouTubeIframeAPIReady with your own callback so you can actually TARGET any dom element with concrete id, instead of only one.)
2) In your directive, use requireJS to pull in reference for your CUSTOM external js file.
require(['youtubeAPI', function(youtubeAPI){
// register directive
.directive('externalYoutube', function() {
return {
restrict: 'EA',
transclude: true,
scope: {},
templateUrl: 'my-dialog.html',
link: function (scope, element) {
youtubeAPI.loaded = function(){
youtubeAPI.wrap(element);
};
}
};
})]);
the usage would be something like
<external-youtube />
in html.