File
Metadata
changeDetection |
ChangeDetectionStrategy.OnPush |
selector |
app-error-dialog |
styleUrls |
./error-dialog.component.scss |
templateUrl |
./error-dialog.component.html |
Constructor
constructor(data: any)
|
|
Parameters :
Name |
Type |
Optional |
data |
any
|
No
|
|
Public
data
|
Type : any
|
Decorators :
@Inject(MAT_DIALOG_DATA)
|
|
import {Component, ChangeDetectionStrategy, Inject} from '@angular/core';
import {MAT_DIALOG_DATA} from '@angular/material/dialog';
@Component({
selector: 'app-error-dialog',
templateUrl: './error-dialog.component.html',
styleUrls: ['./error-dialog.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ErrorDialogComponent {
constructor(@Inject(MAT_DIALOG_DATA) public data: any) { }
}
<div>
<div>
<p>
Message: {{ data.message }}
</p>
<p *ngIf="data.status">
Status: {{ data?.status }}
</p>
</div>
</div>
Legend
Html element with directive