Skip to main content

Class: LoadingButtonDirective

loading-button.LoadingButtonDirective

LoadingButtonDirective passed on a button to show a spinner when loading input boolean is true

Implements​

  • OnInit
  • OnChanges
  • OnDestroy

Constructors​

constructor​

• new LoadingButtonDirective(elRef, componentFactoryResolver, injector, config)

Parameters​

NameType
elRefElementRef<HTMLElement>
componentFactoryResolverComponentFactoryResolver
injectorInjector
configLegiSharedOptions

Defined in​

libs/legi-shared/loading-button/loading-button.directive.ts:32

Properties​

loading​

• loading: boolean = false

Defined in​

libs/legi-shared/loading-button/loading-button.directive.ts:26


loadingOnce​

• Private loadingOnce: boolean = false

Defined in​

libs/legi-shared/loading-button/loading-button.directive.ts:29


spinner​

• Private Optional spinner: ComponentRef<MatSpinner>

Defined in​

libs/legi-shared/loading-button/loading-button.directive.ts:30


spinnerDiv​

• Private Optional spinnerDiv: HTMLElement

Defined in​

libs/legi-shared/loading-button/loading-button.directive.ts:28

Methods​

getSpinnerDiv​

â–¸ Private getSpinnerDiv(): HTMLElement

getSpinnerDiv creates a div element, and appends a spinner to it. Styles of this div vary based on config.appearance

Returns​

HTMLElement

Defined in​

libs/legi-shared/loading-button/loading-button.directive.ts:90


toggleLoading​

â–¸ Private toggleLoading(): void

toggleLoading shows/hides spinner on button based on this.loading value

Returns​

void

Defined in​

libs/legi-shared/loading-button/loading-button.directive.ts:69