File
Metadata
styleUrls |
./editworkspace.component.css |
templateUrl |
./editworkspace.component.html |
Constructor
constructor(data: string)
|
|
Parameters :
Name |
Type |
Optional |
data |
string
|
No
|
|
Public
data
|
Type : string
|
Decorators :
@Inject(MAT_DIALOG_DATA)
|
|
editworkspaceform
|
Default value : new FormGroup({
name: new FormControl('', [Validators.required, Validators.minLength(3)])
})
|
|
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Component, Inject } from '@angular/core';
import { FormGroup, Validators, FormControl } from '@angular/forms';
@Component({
templateUrl: './editworkspace.component.html',
styleUrls: ['./editworkspace.component.css']
})
export class EditworkspaceComponent {
editworkspaceform = new FormGroup({
name: new FormControl('', [Validators.required, Validators.minLength(3)])
});
constructor(
@Inject(MAT_DIALOG_DATA) public data: string
) { }
}
<form [formGroup]="editworkspaceform">
<h1 mat-dialog-title>Arbeitsbereich "{{data}}" ändern</h1>
<mat-dialog-content>
<p>
<mat-form-field class="full-width">
<input matInput formControlName="name" placeholder="Name" [value]="data">
</mat-form-field>
</p>
</mat-dialog-content>
<mat-dialog-actions>
<button mat-raised-button color="primary" type="submit" [mat-dialog-close]="editworkspaceform" [disabled]="editworkspaceform.invalid">Speichern</button>
<button mat-raised-button [mat-dialog-close]="false">Abbrechen</button>
</mat-dialog-actions>
</form>
Legend
Html element with directive