diff --git a/client/src/app/shared/shared-main/buttons/button.component.html b/client/src/app/shared/shared-main/buttons/button.component.html index bf0fb3916..20c982744 100644 --- a/client/src/app/shared/shared-main/buttons/button.component.html +++ b/client/src/app/shared/shared-main/buttons/button.component.html @@ -1,6 +1,6 @@ -
+
+ diff --git a/client/src/app/shared/shared-main/buttons/button.component.ts b/client/src/app/shared/shared-main/buttons/button.component.ts index 1761938ee..63a59cbe1 100644 --- a/client/src/app/shared/shared-main/buttons/button.component.ts +++ b/client/src/app/shared/shared-main/buttons/button.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core' +import { ChangeDetectionStrategy, Component, Input, OnChanges, OnInit } from '@angular/core' import { GlobalIconName } from '@app/shared/shared-icons' @Component({ @@ -8,7 +8,7 @@ import { GlobalIconName } from '@app/shared/shared-icons' changeDetection: ChangeDetectionStrategy.OnPush }) -export class ButtonComponent implements OnChanges { +export class ButtonComponent implements OnInit, OnChanges { @Input() label = '' @Input() className = 'grey-button' @Input() icon: GlobalIconName = undefined @@ -20,7 +20,15 @@ export class ButtonComponent implements OnChanges { classes: { [id: string]: boolean } = {} + ngOnInit () { + this.buildClasses() + } + ngOnChanges () { + this.buildClasses() + } + + private buildClasses () { this.classes = { [this.className]: true, disabled: this.disabled,