edit dashboard and text widgets

This commit is contained in:
2023-03-11 10:39:28 +01:00
parent cb5b160d3c
commit e3945a4d33
10 changed files with 99 additions and 23 deletions

View File

@@ -11,6 +11,6 @@
</mat-form-field>
</div>
<div mat-dialog-actions align="end">
<button mat-button mat-dialog-close>Cancel</button>
<button mat-button mat-dialog-close (click)="close()">Cancel</button>
<button class="save-button" mat-button mat-dialog-close (click)="onSaveClick()">Save</button>
</div>

View File

@@ -1,5 +1,5 @@
import { Component, ElementRef, ViewChild } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
import { Component, ElementRef, Inject, ViewChild } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
@Component({
selector: 'app-add-text-dialog',
@@ -10,7 +10,12 @@ export class AddTextDialogComponent {
@ViewChild('textElement') textElement!: ElementRef;
constructor(public dialogRef: MatDialogRef<string>){
constructor(public dialogRef: MatDialogRef<string|undefined>, @Inject(MAT_DIALOG_DATA) public data: {text: string}){
this.text = data.text;
}
close(): void {
this.dialogRef.close(undefined);
}