当我从API放置滑块数据时,出现此错误吗?

时间:2019-05-20 07:07:59

标签: angular

请帮助我解决这个问题

Uncaught TypeError: Cannot read property 'loaded' of undefined
    at SlideshowComponent.push../node_modules/ng-simple-slideshow/ng-simple-slideshow.es5.js.SlideshowComponent.slide (ng-simple-slideshow.es5.js:236)
    at ng-simple-slideshow.es5.js:446
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
    at Object.onInvoke (core.js:17299)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:390)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:150)
    at NgZone.push../node_modules/@angular/core/fesm5/core.js.NgZone.run (core.js:17213)
    at ng-simple-slideshow.es5.js:446
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)

//代码.ts getAllBanners = [];模型:任何= {}; imageUrls :(字符串| IImage)[] = this.getAllBanners

高度:string ='400px'; minHeight:字符串; arrowSize:字符串='30px'; showArrows:boolean = true; disableSwiping:boolean = false; autoPlay:布尔值= true; autoPlayInterval:数字= 3333; stopAutoPlayOnSlide:boolean = true;调试:布尔=假; backgroundSize:字符串='封面'; backgroundPosition:字符串='中心中心'; backgroundRepeat:字符串='不重复'; hideOnNoSlides:布尔=假;宽度:字符串='100%';全屏显示:boolean = false;

getBanner(){this.action.AllCustomers().subscribe(data => {this.getAllBanners = [{“ url”:'cdn.vox-cdn.com/uploads/chorus_image/image/56748793/…” ,标题:“第一张幻灯片”,href:“#config”},{“ url”:“cdn.vox-cdn.com/uploads/chorus_asset/file/9278671/…'},];}); this.imageUrls = this.getAllBanners; }

0 个答案:

没有答案