<!-- Include YT library and this directive --> <script src="https://www.youtube.com/iframe_api"></script> <script src="angular-youtube-embed.js"></script>
// Create your app with 'youtube-embed' dependency var myApp = angular.module('myApp', ['youtube-embed']);
// Inside your controller... myApp.controller('MyCtrl', function ($scope) { // have a video id $scope.theBestVideo = 'sMKoNBRZM1M'; });
<!-- Use 'youtube-video' as an element or attribute. --> <youtube-video video-id="theBestVideo"></youtube-video>