angular-youtube-embed icon indicating copy to clipboard operation
angular-youtube-embed copied to clipboard

Plugin throws error when used with ionic {{}}

Open royken opened this issue 8 years ago • 3 comments

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}}].

royken avatar Mar 14 '17 15:03 royken

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.

AlvaroHerrero avatar Apr 11 '17 17:04 AlvaroHerrero

thanks @AlvaroHerrero! that's exactly right

brandly avatar Apr 11 '17 20:04 brandly

Thank you !!!

royken avatar Apr 12 '17 12:04 royken