View item in the list in a new page using ionic and firebase


#1

view item in the list in a new page using ionic 3 and firebase

please help me I’m stock here…

import { Component } from ‘@angular/core’;
import { IonicPage, NavController, NavParams } from ‘ionic-angular’;

import { AngularFirestore, AngularFirestoreDocument } from ‘angularfire2/firestore’;
import { Observable } from ‘rxjs/Observable’;
import { Item } from ‘…/…/models/item/item.module’;

@IonicPage()
@Component({
selector: ‘page-view-item’,
templateUrl: ‘view-item.html’,
})
export class ViewItemPage {
item:Item={
postContent:’’,id:’’}

postDoc:AngularFirestoreDocument<Item>;
post:Observable<Item>;

constructor(public navCtrl: NavController, public navParams: NavParams,private afs: AngularFirestore) {
}

ngOnInit(posts) {
this.postDoc = this.afs.doc(‘posts/’+posts.id);
this.post = this.postDoc.valueChanges();

}
}


#3

why?is there something wrong?


#4

I just posted to the wrong topic, thats why I deleted it :slight_smile:

About your topic, you need to describe a lot more, what the problem is, ie show html, error messages

It might eithe be because your are missing async in the html, og because you need to subscribe to this.post


#5

thanks i already solved this issue


#6

How did you solve it? I’m having a similar issue.

Can you post your solution?