Skip to content

help(material-experimental/mdc-button): Why MatFabAnchor component using MAT_BUTTON_INPUTS? #24145

Closed
@enten

Description

@enten

What are you trying to do?

I'm wondering why MatFabAnchor component using MAT_BUTTON_INPUTS as component's inputs? Would that be a mistake?

We can see that MatMiniFabAnchor component using MAT_ANCHOR_INPUTS as component's inputs (instead of MAT_BUTTON_INPUTS).

@Component({
  selector: `a[mat-fab]`,
  templateUrl: 'button.html',
  styleUrls: ['fab.css'],
  inputs: [...MAT_BUTTON_INPUTS, 'extended'],
  host: {
    ...MAT_ANCHOR_HOST,
    '[class.mdc-fab--extended]': 'extended',
    '[class.mat-mdc-extended-fab]': 'extended',
  },
  exportAs: 'matButton, matAnchor',
  encapsulation: ViewEncapsulation.None,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class MatFabAnchor extends MatAnchor {
  // ...
}

@Component({
  selector: `a[mat-mini-fab]`,
  templateUrl: 'button.html',
  styleUrls: ['fab.css'],
  inputs: MAT_ANCHOR_INPUTS,
  host: MAT_ANCHOR_HOST,
  exportAs: 'matButton, matAnchor',
  encapsulation: ViewEncapsulation.None,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class MatMiniFabAnchor extends MatAnchor {
  // ...
}

What troubleshooting steps have you tried?

NA

Reproduction

Steps to reproduce:

  1. See source code material-experimental/mdc-button/fab.ts#L145

Environment

  • Angular: All
  • CDK/Material: material-experimental 24180d1
  • Browser(s): All
  • Operating System (e.g. Windows, macOS, Ubuntu): All

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/button

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions