Issue
Below is my function i am using to filter the data. Error is saying pipe property undefined .
filterMat(){
this.material = this.userservice.matmodel$.pipe(
switchMap(user =>
this.auth.collection$(`users/${this.userservice.getUID()}/MatModel`, ref =>
ref
.where('uid','==',user.uid)
// .where(this.Zita,'==',user.Zita)
.orderBy('date','desc')
)
)
)
}
This is my collection$
collection$(path, query?) {
return this.afs
.collection(path, query)
.snapshotChanges()
.pipe(
map(actions => {
return actions.map(a => {
const data: Object = a.payload.doc.data();
const id = a.payload.doc.id;
return { id, ...data };
});
})
);
}
my matmodel$ is
matmodel$:Observable<MatModel>
Solution
It looks like the matmodel$
is declared but not yet defined.
Try replacing
matmodel$: Observable<MatModel>;
with
matmodel$ = new Observable<MatModel>();
Answered By - ruth
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.