src/app/superadmin/users/newuser/newuser.component.ts
styleUrls | ./newuser.component.css |
templateUrl | ./newuser.component.html |
Properties |
newuserform |
Default value : new FormGroup({
name: new FormControl('', [Validators.required, Validators.minLength(3)]),
pw: new FormControl('', [Validators.required, Validators.minLength(7)])
})
|
import { Component } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
@Component({
templateUrl: './newuser.component.html',
styleUrls: ['./newuser.component.css']
})
export class NewuserComponent {
newuserform = new FormGroup({
name: new FormControl('', [Validators.required, Validators.minLength(3)]),
pw: new FormControl('', [Validators.required, Validators.minLength(7)])
});
}
<form [formGroup]="newuserform">
<h1 mat-dialog-title>Neue/r Nutzer/in</h1>
<mat-dialog-content>
<p>
<mat-form-field class="full-width">
<input matInput formControlName="name" placeholder="Name" autocomplete="off">
</mat-form-field>
</p>
<p>Achtung: Mindestlänge für Kennwort 7 Zeichen</p>
<p>
<mat-form-field class="full-width">
<input matInput type="password" formControlName="pw" placeholder="Kennwort" autocomplete="off">
</mat-form-field>
</p>
<div class="infobox">
<p>Nach dem Anlegen des Nutzers können Sie die Rechte zuweisen.
</p>
</div>
</mat-dialog-content>
<mat-dialog-actions>
<button mat-raised-button color="primary" type="submit" [mat-dialog-close]="newuserform" [disabled]="newuserform.invalid">Speichern</button>
<button mat-raised-button [mat-dialog-close]="false">Abbrechen</button>
</mat-dialog-actions>
</form>
./newuser.component.css