im making a mobile app. In my login form i have 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>
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);
}
}
Label is showing "example" but textField does not. Change value of textField doesnt change value in component logic. Any Idea?
ps. I already imported NativescriptFormsModule in my @ngModule
Make sure you import NativescriptFormsModule on the module that declare SignInPage Component not only in AppModule.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With