通过RadDataForm将数据推送到Firestore

时间:2019-02-15 22:25:00

标签: angular telerik nativescript dataform

我正在使用RadDataForm,我想将其数据添加到Firestore数据库中,但不添加任何内容。当我检查消防站时,我什么也没找到。

<StackLayout>
    <RadDataForm #myScrollingDataForm [source]="user" commitMode="Manual">
        <TKEntityProperty tkDataFormProperty name="firstName" index="0"></TKEntityProperty>
    </RadDataForm>
    <Button text="register" (tap)="creatUser()" horizontalAlignment="stretch"></Button>
</StackLayout>

user.ts

createUser(value,firstName){
    firebase.firestore().collection("user").add({name: firstName})
        .then((docRef: firestore.DocumentReference) => {
            console.log("user added, ref: " + docRef.id);
        })
    }
}

0 个答案:

没有答案