Kam*_*cki 2 typescript nativescript angular2-forms angular2-nativescript angular
即时通讯制作移动应用.在我的登录表单中,我有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 = { user: { email: this.email }, password: this.password };
console.dump(loginParams);
}
}Run Code Online (Sandbox Code Playgroud)
标签显示"示例",但textField没有.更改textField的值不会更改组件逻辑中的值.任何的想法?
PS.我已经在@ngModule中导入了NativescriptFormsModule
| 归档时间: |
|
| 查看次数: |
1532 次 |
| 最近记录: |