i want to get data from firebase using a specifique id
i tried this but it keep taking the id and return null as data
export class Festival{
monument= {} as Monument;
itemList: AngularFireList
itemArray =
imageSource;
musePhoto;
constructor(public navCtrl: NavController, public navParams: NavParams,
public db:AngularFireDatabase,public festivalservice : FestivalserviceProvider,
public alertCtrl: AlertController, public storage:Storage, public router:Router) {
this.itemList = db.list('festival')
this.itemList.snapshotChanges()
.subscribe(actions=>{
actions.forEach(action=>{
let y = action.payload.toJSON()
y["key"] = action.key
this.itemArray.push(y as Monument)
})
})
console.log(this.itemArray)
this.imageSource = 'bardo4';
this.getPhotoUrl();
}
getPhotoUrl(){
firebase.storage().ref().child(‘images/’+this.imageSource+’.jpg’).getDownloadURL().then((url)=>{
this.musePhoto = url;
})
}
moreInfo(key){
this.navCtrl.push(DetailsFestivalPage, {key: key} )
console.log(key);
// this.router.navigate(['detailsfestival/'+key])
}
}
export class Details {
id:string;
itemArray=;
constructor( public museService:FestivalserviceProvider,
public activatedRoute:ActivatedRoute) {
this.id = this.activatedRoute.snapshot.params[‘id’];
this.museService.getFestival(this.id).snapshotChanges().subscribe(actions=>{
let y = actions.payload.toJSON()
this.itemArray.push(y as Monument)
});
console.log(this.itemArray);
}
}