MCPcopy Create free account
hub / github.com/angular/components / _inferAppearance

Function _inferAppearance

src/material/button/button.ts:92–110  ·  view source on GitHub ↗

Infers the button's appearance from its static attributes.

(button: HTMLElement)

Source from the content-addressed store, hash-verified

90
91/** Infers the button's appearance from its static attributes. */
92function _inferAppearance(button: HTMLElement): MatButtonAppearance | null {
93 if (button.hasAttribute('mat-raised-button')) {
94 return 'elevated';
95 }
96
97 if (button.hasAttribute('mat-stroked-button')) {
98 return 'outlined';
99 }
100
101 if (button.hasAttribute('mat-flat-button')) {
102 return 'filled';
103 }
104
105 if (button.hasAttribute('mat-button')) {
106 return 'text';
107 }
108
109 return null;
110}
111
112// tslint:disable:variable-name
113/**

Callers 1

constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected