Closed cristianchaparroa closed 8 years ago
Hello I'm trying to use it with Ionic and I've a problem with video-id , when I see the source code, I see the name of variable not the value.
Ionic
video-id
So this is my view:
view
<ion-list ng-controller="ListController as vm"> <ion-item ng-repeat="video in vm.videos"> {{video.title}} <div class="item item-thumbnail-left"> <youtube-video class="embed-responsive-item" video-id="video.videoId" ></youtube-video> </div> </ion-item> </ion-list>
And this is my controller:
controller
(function(){ 'use strict'; angular .module('app') .controller('ListController', ['videoService',ListController]); function ListController(videoService) { var vm = this; vm.videos = []; loadVideos(); function loadVideos() { return getVideos().then(function(){ console.log('loading videos...'); }); } function getVideos() { return videoService.getVideos().then(function(data){ vm.videos = data; return vm.videos; }); } } })();
The vm.videos look like:
vm.videos
{"1G4isv_Fylg":{"videoId":"1G4isv_Fylg","title":"Coldplay - Paradise (Official Video)", "urlThumbnails":"https://i.ytimg.com/vi/1G4isv_Fylg/hqdefault.jpg", "urlEmbed":"www.youtube.com/embed/1G4isv_Fylg"}, "YykjpeuMNEk":{"videoId":"YykjpeuMNEk","title":"Coldplay - Hymn For The Weekend (Official video)", "urlThumbnails":"https://i.ytimg.com/vi/YykjpeuMNEk/hqdefault.jpg", "urlEmbed":"www.youtube.com/embed/YykjpeuMNEk"} }
What am I doing wrong?
Hello I'm trying to use it with
Ionic
and I've a problem withvideo-id
, when I see the source code, I see the name of variable not the value.So this is my
view
:And this is my
controller
:The
vm.videos
look like:What am I doing wrong?