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

Method constructor

src/material/sort/sort-header.ts:120–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

118 disableClear!: boolean;
119
120 constructor() {
121 inject(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);
122 const defaultOptions = inject<MatSortDefaultOptions>(MAT_SORT_DEFAULT_OPTIONS, {
123 optional: true,
124 });
125
126 // Note that we use a string token for the `_columnDef`, because the value is provided both by
127 // `material/table` and `cdk/table` and we can't have the CDK depending on Material,
128 // and we want to avoid having the sort header depending on the CDK table because
129 // of this single reference.
130 if (!this._sort && (typeof ngDevMode === 'undefined' || ngDevMode)) {
131 throw getSortHeaderNotContainedWithinSortError();
132 }
133
134 if (defaultOptions?.arrowPosition) {
135 this.arrowPosition = defaultOptions?.arrowPosition;
136 }
137 }
138
139 ngOnInit() {
140 if (!this.id && this._columnDef) {

Callers

nothing calls this directly

Calls 2

loadMethod · 0.80

Tested by

no test coverage detected