Skip to content

Commit

Permalink
fix(primeng/p-button): not working loadingIcon property, update loa…
Browse files Browse the repository at this point in the history
…dingdoc example

Fixes primefaces#13098.
  • Loading branch information
volvachev authored and steve3d committed Aug 28, 2023
1 parent b4206a3 commit 63066f3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/app/showcase/doc/button/loadingdoc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Input } from '@angular/core';
import { ChangeDetectorRef, Component, Input } from '@angular/core';
import { Code } from '../../domain/code';

@Component({
Expand All @@ -9,6 +9,8 @@ import { Code } from '../../domain/code';
</app-docsectiontext>
<div class="card flex justify-content-center">
<p-button label="Submit" [loading]="loading" (click)="load()"></p-button>
<p-button label="Loading custom icon" [loading]="loading" loadingIcon="pi pi-bell" (click)="load()"></p-button>
</div>
<app-code [code]="code" selector="button-loading-demo"></app-code>
</section>`
Expand All @@ -20,21 +22,26 @@ export class LoadingDoc {

loading: boolean = false;

constructor(private readonly cdr: ChangeDetectorRef) {}

load() {
this.loading = true;

setTimeout(() => {
this.loading = false;
this.cdr.markForCheck();
}, 2000);
}

code: Code = {
basic: `
<p-button label="Submit" [loading]="loading" (click)="load()"></p-button>`,
<p-button label="Submit" [loading]="loading" (click)="load()"></p-button>
<p-button label="Loading custom icon" [loading]="loading" loadingIcon="pi pi-bell" (click)="load()"></p-button>`,

html: `
<div class="card flex justify-content-center">
<p-button label="Submit" [loading]="loading" (click)="load()"></p-button>
<p-button label="Loading custom icon" [loading]="loading" loadingIcon="pi pi-bell" (click)="load()"></p-button>
</div>`,

typescript: `
Expand Down

0 comments on commit 63066f3

Please sign in to comment.