src/module/components/dialogs/mat-timer-dialog/mat-timer-dialog.component.ts
selector | mat-timer-dialog |
styleUrls | ./mat-timer-dialog.component.scss |
templateUrl | ./mat-timer-dialog.component.html |
Properties |
Methods |
constructor(dialogRef: MatDialogRef
|
|||||||||
Parameters :
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
color |
Type : ThemePalette
|
Public data |
Type : MatTimerDialogData
|
Decorators :
@Optional()
|
Public dialogRef |
Type : MatDialogRef<MatTimerDialog>
|
icon |
Type : string
|
title |
Type : string
|
import {Component, Inject, OnInit, Optional} from '@angular/core';
import {MAT_DIALOG_DATA, MatDialogRef, ThemePalette} from '@angular/material';
export interface MatTimerDialogData {
title?: string;
icon?: string;
color?: ThemePalette;
}
@Component({
selector: 'mat-timer-dialog',
templateUrl: './mat-timer-dialog.component.html',
styleUrls: ['./mat-timer-dialog.component.scss']
})
export class MatTimerDialog implements OnInit {
title: string;
icon: string;
color: ThemePalette;
constructor(public dialogRef: MatDialogRef<MatTimerDialog>,
@Optional() @Inject(MAT_DIALOG_DATA) public data: MatTimerDialogData) {
}
ngOnInit() {
if (this.data) {
this.title = this.data.title ? this.data.title : 'Loading...';
this.icon = this.data.icon ? this.data.icon : '';
this.color = this.data.color ? this.data.color : 'primary';
}
}
}
<p>
mat-timer-dialog works!
</p>
./mat-timer-dialog.component.scss