I’m having an issue right now since I’m still a newbie here in ionic firebase’s world. I don’t really know how to pass a list selected from a page into another page. Can somebody help me?
here is my firebase.service
import { Injectable } from '@angular/core';
import { AngularFirestore } from '@angular/fire/firestore';
import * as firebase from 'firebase/app';
import 'firebase/storage';
import { AngularFireAuth } from '@angular/fire/auth';
@Injectable({
providedIn: 'root'
})
export class FirebaseService {
constructor(
public afs: AngularFirestore,
public afAuth: AngularFireAuth) {
}
getStudent(){
return new Promise<any>((resolve, reject) => {
this.afs.collection('/StudentList').snapshotChanges()
.subscribe(snapshots => {
resolve(snapshots)
})
})
}
getStudents(userKey){
return new Promise<any>((resolve, reject) => {
return this.afs.collection('/StudentList').doc(userKey).snapshotChanges()
.subscribe(snapshots => {
resolve(snapshots)
})
})
}
}
and here is my studlist.html where I want to select a list
What I would do instead is to have a service that tracks the currently selected student and exposes it as an Observable. The general idiom is described here. The strategy @Hammad6264 is proposing relies on serializing things into user-facing URLs, which I have found to be ugly and brittle. I would not recommend trying to pass any data through Angular’s router any more complex than URL-safe scalars.
Hi girl
Nice meet you.
I have also same issue, so I want to know you if you are very similar to IONIC, React Native.
If you are Okay, Pls ping me here.