Я исправил эту ошибку, используя оператор карты без канала.Этот код работает
import { Injectable } from '@angular/core';
import { AngularFireAuth } from 'angularfire2/auth';
import { AngularFirestore, AngularFirestoreCollection } from '@angular/fire/firestore';
import { Observable } from 'rxjs';
import 'rxjs/add/operator/map';
@Injectable()
export class UserService {
uid;
userCol : AngularFirestoreCollection<UserInter>;
users : Observable<any>;
constructor(private Uauth:AngularFireAuth, private afs:AngularFirestore) { }
GetUsers(){
this.userCol = this.afs.collection('users');
this.users = this.userCol.snapshotChanges()
.map(action => {
return action.map(a => {
const data = a.payload.doc.data() as UserInter;
const id = a.payload.doc.id;
return {id, data };
})
})
return this.users;
}
}
export interface UserInter {
email ?: string,
pass ?: string,
Rpass ?: string,
Firstname ?: string,
Lastname ?: string,
Society ?: string,
Landmark ?: string,
Address ?: string,
PrimaryNo ?: string,
SecondaryNo ?: string,
ExpiryDate ?: Date,
Orders ?: string,
}
export interface UserInterid extends UserInter {id ?: string }