Marco Marco - 1 year ago 137
AngularJS Question

Angular youtube-embed error when passing a variable in ng repeat

I have installed this youtube-embed package in order to do manipulate elements on my page on player events. In my app I am listing articles with

so I need to pass the video url as a variable to the directive. Since on the package github page it is described that you should pass a
$scope variable
name as a string to the directive in order to display a video, since I can't pass it as a scope variable, I wonder if I can pass it in ng-repeat?
Because when I do it like this I get an error:

<youtube-video video-url="{{article.external_media[0].original_url}}"></youtube-video>

ionic.bundle.js:26794 Error: [$parse:syntax] Syntax Error: Token '{'
invalid key at column 2 of the expression
[{{article.external_media[0].original_url}}] starting at

Answer Source
<youtube-video video-url="linkVariable"></youtube-video>
<youtube-video video-url="''"></youtube-video>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download