please help me how can i pass my textbox values to typesccript
请帮助我如何将我的文本框值传递给typesccript
Student.ts this is my class its having Email And password this call i used in studentController
Student.ts这是我的班级,它有电子邮件和密码这个叫我在studentController中使用的电话
export class Validationclass { Email: string; Password: string; } export class studentController { public val: Validationclass; Validation() { if (this.val.Email != null && this.val.Password != null) { alert('ok') } else alert("Emptr"); }
0
You need to assign the ngModel to the correct vars in your controller like this:
您需要将ngModel分配给控制器中的正确变量,如下所示:
Make sure in your controller to initialize the ValidationClass like this:
确保在控制器中初始化ValidationClass,如下所示:
ngOnInit() { val = new Validationclass(); }