brandly / angular-youtube-embed

:tv: Embed a YouTube player with a simple directive
http://brandly.github.io/angular-youtube-embed/
MIT License
510 stars 147 forks source link

Plugin throws error when used with ionic {{}} #146

Open royken opened 7 years ago

royken commented 7 years ago

Does not work when using the ionic {{}}. This is my code

<youtube-video video-id="{{campagne.video}}" player-width="'560px'" player-height="'315px'"></youtube-video>

And this is the error i get: ionic.bundle.js:19890 Error: [$parse:syntax] Syntax Error: Token '{' invalid key at column 2 of the expression [{{campagne.video}}] starting at [{campagne.video}}].

AlvaroHerrero commented 7 years ago

Curly braces are not needed to set the values to the attributes, so you can just type:

<youtube-video video-id="campagne.video" player-width="'560px'" player-height="'315px'"></youtube-video>

Don´t forget to attach the campagne.video to the $scope on the controller.

brandly commented 7 years ago

thanks @AlvaroHerrero! that's exactly right

royken commented 7 years ago

Thank you !!!