Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/220.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 使用nativescript输入submit empty_Android_Typescript_Mobile_Input_Nativescript - Fatal编程技术网

Android 使用nativescript输入submit empty

Android 使用nativescript输入submit empty,android,typescript,mobile,input,nativescript,Android,Typescript,Mobile,Input,Nativescript,我想注册用户,但我的输入值为空: 我一步一步地遵循这一点。我看不出我的代码有任何问题。有什么想法吗 Component.html <GridLayout backgroundColor="#CCCCCC"> <ScrollView> <StackLayout margin="10" verticalAlignment="center"> <StackLayout class="fo

我想注册用户,但我的输入值为空:

我一步一步地遵循这一点。我看不出我的代码有任何问题。有什么想法吗

Component.html

 <GridLayout backgroundColor="#CCCCCC">
        <ScrollView>
            <StackLayout margin="10" verticalAlignment="center">
                <StackLayout class="form" padding="15" backgroundColor="#FFFFFF">
                    <StackLayout class="input-field">
                        <Label text="First Name" class="label font-weight-bold m-b-5"></Label>
                        <TextField class="input" value="input.firstname"></TextField>
                        <StackLayout class="hr-light"></StackLayout>
                    </StackLayout>
                    <StackLayout class="input-field">
                        <Label text="Last Name" class="label font-weight-bold m-b-5"></Label>
                        <TextField class="input" [(ngModel)]="input.lastname"></TextField>
                        <StackLayout class="hr-light"></StackLayout>
                    </StackLayout>
                    <StackLayout class="input-field">
                        <Label text="Email" class="label font-weight-bold m-b-5"></Label>
                        <TextField class="input" [(ngModel)]="input.email"></TextField>
                        <StackLayout class="hr-light"></StackLayout>
                    </StackLayout>
                    <StackLayout class="input-field">
                        <Label text="Password" class="label font-weight-bold m-b-5"></Label>
                        <TextField  secure="true" [(ngModel)]="input.password" class="input" required></TextField>
                        <StackLayout class="hr-light"></StackLayout>
                    </StackLayout>
                    <Button class="btn btn-primary w-full" text="Register" (tap)="register()"></Button>
                </StackLayout>
            </StackLayout>
        </ScrollView>
    </GridLayout>

我不明白为什么我的值是空的!!您能问我一些想法吗?

若要在相关模块中导入
NativeScriptFormsModule
,请启用双向绑定检查。如果应用程序未使用延迟加载,则应将其作为主
app.module.ts

// Uncomment and add to NgModule imports if you need to use two-way binding
import { NativeScriptFormsModule } from "nativescript-angular/forms";

imports: [
    NativeScriptFormsModule // ADD it to imports
],

请注意,您共享的代码只是在应用程序设置中保存了一个键值,以后您应该重新使用该键值登录用户(通过访问特定的键
帐户

缺少firstname的模型)
// Uncomment and add to NgModule imports if you need to use two-way binding
import { NativeScriptFormsModule } from "nativescript-angular/forms";

imports: [
    NativeScriptFormsModule // ADD it to imports
],