Code format
This commit is contained in:
@@ -10,8 +10,8 @@ import { FormsModule } from '@angular/forms';
|
||||
@Component({
|
||||
selector: 'app-messages-demo',
|
||||
standalone: true,
|
||||
imports:[CommonModule,ToastModule,ButtonModule,InputTextModule,MessageModule,FormsModule],
|
||||
template:`
|
||||
imports: [CommonModule, ToastModule, ButtonModule, InputTextModule, MessageModule, FormsModule],
|
||||
template: `
|
||||
<div class="flex flex-col md:flex-row gap-8">
|
||||
<div class="md:w-1/2">
|
||||
<div class="card">
|
||||
@@ -25,7 +25,7 @@ import { FormsModule } from '@angular/forms';
|
||||
|
||||
<div class="font-semibold text-xl mt-4 mb-4">Inline</div>
|
||||
<div class="flex flex-wrap mb-4 gap-2">
|
||||
<input pInputText [(ngModel)]="username" placeholder="Username" aria-label="username" class="ng-dirty ng-invalid"/>
|
||||
<input pInputText [(ngModel)]="username" placeholder="Username" aria-label="username" class="ng-dirty ng-invalid" />
|
||||
<p-message severity="error">Username is required</p-message>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
@@ -52,14 +52,13 @@ import { FormsModule } from '@angular/forms';
|
||||
providers: [MessageService]
|
||||
})
|
||||
export class MessagesDemo {
|
||||
|
||||
msgs: ToastMessageOptions[] | null = [];
|
||||
|
||||
username: string | undefined
|
||||
username: string | undefined;
|
||||
|
||||
email: string | undefined
|
||||
email: string | undefined;
|
||||
|
||||
constructor(private service: MessageService) { }
|
||||
constructor(private service: MessageService) {}
|
||||
|
||||
showInfoViaToast() {
|
||||
this.service.add({ key: 'tst', severity: 'info', summary: 'Info Message', detail: 'PrimeNG rocks' });
|
||||
@@ -96,5 +95,4 @@ export class MessagesDemo {
|
||||
this.msgs = [];
|
||||
this.msgs.push({ severity: 'success', summary: 'Success Message', detail: 'Message sent' });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user