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

Method constructor

src/material/button/button.ts:55–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53 private _appearance: MatButtonAppearance | null = null;
54
55 constructor() {
56 super();
57 const inferredAppearance = _inferAppearance(this._elementRef.nativeElement);
58
59 // Only set the appearance if we managed to infer it from the static attributes, rather than
60 // doing something like `setAppearance(inferredAppearance || 'text')`, because doing so can
61 // cause the fallback appearance's classes to be set and then immediately replaced when
62 // the input value is assigned.
63 if (inferredAppearance) {
64 this.setAppearance(inferredAppearance);
65 }
66 }
67
68 /** Programmatically sets the appearance of the button. */
69 setAppearance(appearance: MatButtonAppearance): void {

Callers

nothing calls this directly

Calls 2

setAppearanceMethod · 0.95
_inferAppearanceFunction · 0.85

Tested by

no test coverage detected