getVideo(){
var jsonBody = {};
jsonBody['activity'] = "videoUrls";
var apiUrl = "apiurl/";
this.postCall(jsonBody, apiUrl)
.subscribe(
data => {
if (data.message == "ok") {
this.showVideo=true
this.videoList=data.data.videoslist
}
},
err => {
this.showVideo=false
if (err.json().message == 'videos not found') {
console.log("videos not found")
} else {
console.log("videos not found")
}
});
}
setVideo()
{
console.log("s")
return this.videoList;
}
Above is my service.ts file
this.VideoService.getVideo();
this.VideoService.setVideo().subscribe(
item => {
console.log(item)
})
это код, который я написал в файле component.ts
ОШИБКА происходит Ошибка типа ОШИБКА: не удается прочитать свойство «подписка» неопределенного
для совместного использования данных между двумяразличные компоненты