Skip to content
Snippets Groups Projects
Commit edb5046f authored by OZGCloud's avatar OZGCloud
Browse files

OZG-296 revert button refactoring

parent 205ae09f
No related branches found
No related tags found
No related merge requests found
<button mat-stroked-button *ngIf="stateResource" <button mat-stroked-button
[color]="color" [color]="color"
[type]="type" [type]="type"
[disabled]="isDisabled" [disabled]="isDisabled"
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<goofy-client-spinner <goofy-client-spinner
[diameter]="22" [diameter]="22"
padding="0" padding="0"
[stateResource]="stateResource"> [stateResource]="getStateResource()">
</goofy-client-spinner> </goofy-client-spinner>
</button> </button>
...@@ -12,13 +12,17 @@ export class ButtonWithSpinnerComponent { ...@@ -12,13 +12,17 @@ export class ButtonWithSpinnerComponent {
@Input() icon: string; @Input() icon: string;
@Input() svgIcon: string; @Input() svgIcon: string;
@Input() text: string; @Input() text: string;
@Input() stateResource: StateResource<any> = createEmptyStateResource(); @Input() stateResource: StateResource<any>;
@Input() color: string = 'primary'; @Input() color: string = 'primary';
@Input() type: string = 'button'; @Input() type: string = 'button';
@Output() public clickEmitter: EventEmitter<MouseEvent> = new EventEmitter<MouseEvent>(); @Output() public clickEmitter: EventEmitter<MouseEvent> = new EventEmitter<MouseEvent>();
get isDisabled(): boolean { get isDisabled(): boolean {
return this.stateResource.loading; return this.getStateResource().loading;
}
getStateResource(): StateResource<any> {
return isNil(this.stateResource) ? createEmptyStateResource() : this.stateResource;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment