Skip to content

Commit

Permalink
updated splitbutton templatedoc example
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed May 9, 2024
1 parent b12220f commit c5561cf
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions src/app/showcase/doc/splitbutton/templatedoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Code } from '@domain/code';
</app-docsectiontext>
<div class="card flex justify-content-center">
<p-toast />
<p-splitButton label="Save" (onClick)="save('info')" severity="warning" [model]="items">
<p-splitButton label="Save" (onClick)="save('info')" severity="contrast" [model]="items">
<ng-template pTemplate="content">
<span class="flex align-items-center font-bold">
<img alt="logo" src="https://primefaces.org/cdn/primeng/images/logo.svg" style="height: 1rem; margin-right: 0.5rem" />
Expand All @@ -24,6 +24,8 @@ import { Code } from '@domain/code';
providers: [MessageService]
})
export class TemplateDoc {
items: MenuItem[];

constructor(private messageService: MessageService) {
this.items = [
{
Expand All @@ -44,8 +46,6 @@ export class TemplateDoc {
];
}

items: MenuItem[];

save(severity: string) {
this.messageService.add({ severity: severity, summary: 'Success', detail: 'Data Saved' });
}
Expand All @@ -62,14 +62,36 @@ export class TemplateDoc {
basic: `<p-splitButton
label="Save"
(onClick)="save('info')"
[model]="items" />`,
severity="contrast"
[model]="items">
<ng-template pTemplate="content">
<span class="flex align-items-center font-bold">
<img
alt="logo"
src="https://primefaces.org/cdn/primeng/images/logo.svg"
style="height: 1rem; margin-right: 0.5rem" />
<span>PrimeNG</span>
</span>
</ng-template>
</p-splitButton>`,

html: `<div class="card flex justify-content-center">
<p-toast />
<p-splitButton
label="Save"
(onClick)="save('info')"
[model]="items" />
severity="contrast"
[model]="items">
<ng-template pTemplate="content">
<span class="flex align-items-center font-bold">
<img
alt="logo"
src="https://primefaces.org/cdn/primeng/images/logo.svg"
style="height: 1rem; margin-right: 0.5rem" />
<span>PrimeNG</span>
</span>
</ng-template>
</p-splitButton>
</div>`,

typescript: `import { Component } from '@angular/core';
Expand All @@ -86,7 +108,7 @@ import { ToastModule } from 'primeng/toast';
})
export class SplitButtonTemplateDemo {
items: MenuItem[];
constructor(private messageService: MessageService) {
this.items = [
{
Expand Down

0 comments on commit c5561cf

Please sign in to comment.