runbox7 icon indicating copy to clipboard operation
runbox7 copied to clipboard

fix(login): make username and password required

Open shadowbas opened this issue 7 months ago • 3 comments

Remove the empty redundant ngModel directive.

shadowbas avatar Jun 16 '25 14:06 shadowbas

It looks like validation is supported in template-driven forms, and as we don't need to capture valuechanges or similar, I think this would be better in KISS style by just adding "required" to the input fields, rather than switching to Reactive forms: https://v16.angular.io/guide/form-validation

@castaway, Required using angular material does not behave like native inputs. It behaves as if required is not defined.

shadowbas avatar Jun 17 '25 10:06 shadowbas

I guess, what I said is not completely correct. The main issue really is that one has to render the errors themselves using mat-error component. The reactive approach has the rendering of errors baked in.

shadowbas avatar Jun 17 '25 10:06 shadowbas

@castaway , you are correct that template driven forms offer the ability to perform required validation. I read that forms with validation should use reactive forms and went with that.

shadowbas avatar Jun 17 '25 11:06 shadowbas

@castaway, rebased and ready to merge.

shadowbas avatar Jul 01 '25 10:07 shadowbas