我正在尝试使用Angularfire2(v5.0.0-rc.3),但我收到了CORS问题
由于访问权限,XMLHttpRequest无法加载https://firestore.googleapis.com/google.firestore.v1beta1.Firestore/Listen/channel?gsessionid=w5AH2plIbmZY17fjCAsl4-KEpD1GjKtr&VER=8&RID=rpc&SID=bFGKCCIqerIWjB6AlU9X0Q&CI=0&AID=4&TYPE=xmlhttp&zx=ul0vajwsa7m2&t=2控制检查 .
这是我的服务,它会触发此错误
import { AngularFirestore, AngularFirestoreCollection } from 'angularfire2/firestore';
@Injectable()
export class ClientsService {
private clientsCollection: AngularFirestoreCollection<Client>;
clients: Observable<Client[]>;
constructor(private afs: AngularFirestore) {
this.clientsCollection = afs.collection<Client>('clients');
this.clients = this.clientsCollection.valueChanges();
}
updateClients = (params: any): Promise<Client[]> => {
this.clientsCollection = this.afs.collection('clients')
this.clients = this.clientsCollection.valueChanges()
return this.clients.toPromise()
}
}
有人有什么建议吗?