michaeldoye / mat-progress-buttons

Very simple Angular6+ Material Design progress buttons
https://mat-progress-buttons.firebaseapp.com/
MIT License
110 stars 54 forks source link

feat(lib): add global options #80

Closed michaeldoye closed 3 years ago

michaeldoye commented 3 years ago

Fixes #30

Global Options

Optionally pass default MatProgressButtonOptions in forRoot in side your app.modlue.ts for each button as an array.

const button1: MatProgressButtonOptions = {
  id: 'button1', // Id should match the [buttonId] input
  ...
};

@NgModule({
  imports: [
    MatProgressButtonsModule.forRoot([button1]),
  ],
  declarations: [HomeComponent],
})

NB: add the id above should match the id provided in the [buttonId] input.

<mat-bar-button
  (btnClick)="handleClick()"
  [buttonId]="'button1'"
  [active]="buttonActiveState"
></mat-bar-button>

[options] will override Global Options provided in forRoot