add template

This commit is contained in:
Cetin Cakiroglu
2021-12-09 17:24:42 +03:00
parent cf85fcad02
commit 89b1bf58fa
440 changed files with 292236 additions and 9948 deletions

View File

@@ -0,0 +1,58 @@
import {Component} from '@angular/core';
import {Message, MessageService} from 'primeng/api';
@Component({
templateUrl: './messagesdemo.component.html',
styles: [`
:host ::ng-deep .p-button {
min-width: 8em;
}
:host ::ng-deep .p-message {
margin-left: .25em;
}
`],
providers: [MessageService]
})
export class MessagesDemoComponent {
msgs: Message[] = [];
constructor(private service: MessageService) {}
showInfoViaToast() {
this.service.add({key: 'tst', severity: 'info', summary: 'Info Message', detail: 'PrimeNG rocks'});
}
showWarnViaToast() {
this.service.add({key: 'tst', severity: 'warn', summary: 'Warn Message', detail: 'There are unsaved changes'});
}
showErrorViaToast() {
this.service.add({ key: 'tst', severity: 'error', summary: 'Error Message', detail: 'Validation failed' });
}
showSuccessViaToast() {
this.service.add({ key: 'tst', severity: 'success', summary: 'Success Message', detail: 'Message sent' });
}
showInfoViaMessages() {
this.msgs = [];
this.msgs.push({ severity: 'info', summary: 'Info Message', detail: 'PrimeNG rocks' });
}
showWarnViaMessages() {
this.msgs = [];
this.msgs.push({ severity: 'warn', summary: 'Warn Message', detail: 'There are unsaved changes' });
}
showErrorViaMessages() {
this.msgs = [];
this.msgs.push({ severity: 'error', summary: 'Error Message', detail: 'Validation failed' });
}
showSuccessViaMessages() {
this.msgs = [];
this.msgs.push({ severity: 'success', summary: 'Success Message', detail: 'Message sent' });
}
}