小编Kam*_*cki的帖子

NativeScript ng2双向绑定在TextField上不起作用

即时通讯制作移动应用.在我的登录表单中,我有2个TextFields

<TextField hint="Email Address" keyboardType="email" [(ngModel)]="email" autocorrect="false" autocapitalizationType="none"></TextField>
<TextField hint="Password" secure="true" [(ngModel)]="password"></TextField>
 <Label [text]="email"></Label>
Run Code Online (Sandbox Code Playgroud)

在component.ts中

import { Component, OnInit } from '@angular/core';
import { Router } from "@angular/router";
import { NativeScriptRouterModule } from "nativescript-angular/router";
import { Page } from "ui/page";
import * as Toast from 'nativescript-toast';
@Component({
    moduleId: module.id,
    selector: 'sign-in',
    templateUrl: "template.html"
})
export class SignInPage implements OnInit {
    email: string ="example";
    password: string;
    constructor(private router: Router, page: Page) {
        page.actionBarHidden = true;
    }
    ngOnInit() {

        var loginParams = …
Run Code Online (Sandbox Code Playgroud)

typescript nativescript angular2-forms angular2-nativescript angular

2
推荐指数
1
解决办法
1532
查看次数