We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fc1dd6d commit d48c3aeCopy full SHA for d48c3ae
1 file changed
src/app/login/components/login-form/login-form.component.ts
@@ -26,16 +26,22 @@ export class LoginFormComponent {
26
27
public onLogin() {
28
if (this.form.valid) {
29
- this.login.emit(this.form.value);
+ if ((this.form.value.username) && (this.form.value.password)) {
30
+ const user = new LoginUser();
31
+ user.username = this.form.value.username;
32
+ user.password = this.form.value.password;
33
+
34
+ this.login.emit(user);
35
+ }
36
}
37
38
39
public isFormInvalid(field: string): boolean {
40
let invalid: boolean;
41
- if(this.form.invalid) {
42
+ if (this.form.invalid) {
43
const formField = this.form.get(field);
- if(formField){
44
+ if (formField) {
45
invalid = (formField?.dirty || formField?.touched) && (formField?.errors != null);
46
} else {
47
invalid = false;
0 commit comments