试图将数据保存到 firebase
Trying to save data into firebase
我正在尝试在 firebase 中创建一个 collection 并在其上保存我的一些数据。
import { Component, OnInit } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/auth';
import { AngularFirestore } from '@angular/fire/firestore';
@Component({
selector: 'app-tab',
templateUrl: './tab.page.html',
styleUrls: ['./tab.page.scss'],
})
export class TabPage implements OnInit {
constructor(
private afAuth: AngularFireAuth,
private afs: AngularFirestore
) { }
ngOnInit() {
}
Save() {
return this.afs.collection('INFO');
}
}
我的 html 文件中使用了 Save() 方法:
<ion-card text-center>
<ion-input placeholder="RMSSD"></ion-input>
<ion-button expand="block" (click)="Save()">
Save
</ion-button>
</ion-card>
例如,我不保存任何数据,我只是希望在单击按钮时创建我的 collection。当我点击它时,我没有错误,但在 firebase 中没有任何反应
谢谢
集合需要包含一个文档才能显示在您的控制台中。如果您创建文档,那么您应该会看到该集合。
我正在尝试在 firebase 中创建一个 collection 并在其上保存我的一些数据。
import { Component, OnInit } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/auth';
import { AngularFirestore } from '@angular/fire/firestore';
@Component({
selector: 'app-tab',
templateUrl: './tab.page.html',
styleUrls: ['./tab.page.scss'],
})
export class TabPage implements OnInit {
constructor(
private afAuth: AngularFireAuth,
private afs: AngularFirestore
) { }
ngOnInit() {
}
Save() {
return this.afs.collection('INFO');
}
}
我的 html 文件中使用了 Save() 方法:
<ion-card text-center>
<ion-input placeholder="RMSSD"></ion-input>
<ion-button expand="block" (click)="Save()">
Save
</ion-button>
</ion-card>
例如,我不保存任何数据,我只是希望在单击按钮时创建我的 collection。当我点击它时,我没有错误,但在 firebase 中没有任何反应
谢谢
集合需要包含一个文档才能显示在您的控制台中。如果您创建文档,那么您应该会看到该集合。