im Erstellen einer mobilen App. ich habe 2 Textfelder in AnmeldungsformularNativeScript ng2 Zwei-Wege-Bindung funktioniert nicht auf TextField
<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>
in 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);
}
}
Etikett zeigt "Beispiel", aber Textfield nicht. Der Wert von textField ändert den Wert in der Komponentenlogik nicht. Irgendeine Idee?
ps. Ich habe bereits NativescriptFormsModule in mein @ ngModule importiert
Ich importierte dieses Modul in meiner Komponente immer noch nicht funktioniert :( –
Add code für Ihr Modul –
Ich verstehe Sie zum ersten Mal. Ich mache was Yoy sagen und seine Arbeit! Danke Kumpel! –