Skip to content

Commit 9e7692e

Browse files
committed
fix(): add exportAs to missing components
* Adds the `exportAs` option to the missing components inside of Angular Material Fixes #7361
1 parent b5310da commit 9e7692e

File tree

38 files changed

+54
-4
lines changed

38 files changed

+54
-4
lines changed

src/cdk/observers/observe-content.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ export class MatMutationObserverFactory {
3737
* its associated element has changed.
3838
*/
3939
@Directive({
40-
selector: '[cdkObserveContent]'
40+
selector: '[cdkObserveContent]',
41+
exportAs: 'cdkObserveContent',
4142
})
4243
export class ObserveContent implements AfterContentInit, OnDestroy {
4344
private _observer: MutationObserver | null;

src/cdk/portal/portal-directives.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export class TemplatePortalDirective extends TemplatePortal<any> {
4949
*/
5050
@Directive({
5151
selector: '[cdkPortalHost], [portalHost]',
52+
exportAs: 'cdkPortalHost',
5253
inputs: ['portal: cdkPortalHost']
5354
})
5455
export class PortalHostDirective extends BasePortalHost implements OnDestroy {

src/cdk/stepper/stepper.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export class StepperSelectionEvent {
5959
@Component({
6060
moduleId: module.id,
6161
selector: 'cdk-step',
62+
exportAs: 'cdkStep',
6263
templateUrl: 'step.html',
6364
encapsulation: ViewEncapsulation.None,
6465
preserveWhitespaces: false,
@@ -119,6 +120,7 @@ export class CdkStep {
119120

120121
@Directive({
121122
selector: '[cdkStepper]',
123+
exportAs: 'cdkStepper',
122124
})
123125
export class CdkStepper {
124126
/** The list of step components that the stepper is holding. */

src/cdk/table/table.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export const CDK_TABLE_TEMPLATE = `
7575
@Component({
7676
moduleId: module.id,
7777
selector: 'cdk-table',
78+
exportAs: 'cdkTable',
7879
template: CDK_TABLE_TEMPLATE,
7980
host: {
8081
'class': 'cdk-table',

src/lib/button-toggle/button-toggle.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ export class MatButtonToggleGroupMultiple extends _MatButtonToggleGroupMixinBase
270270
styleUrls: ['button-toggle.css'],
271271
encapsulation: ViewEncapsulation.None,
272272
preserveWhitespaces: false,
273+
exportAs: 'matButtonToggle',
273274
changeDetection: ChangeDetectionStrategy.OnPush,
274275
host: {
275276
'[class.mat-button-toggle-standalone]': '!buttonToggleGroup && !buttonToggleGroupMultiple',

src/lib/button/button.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export const _MatButtonMixinBase = mixinColor(mixinDisabled(mixinDisableRipple(M
116116
moduleId: module.id,
117117
selector: `button[mat-button], button[mat-raised-button], button[mat-icon-button],
118118
button[mat-fab], button[mat-mini-fab]`,
119+
exportAs: 'matButton',
119120
host: {
120121
'[disabled]': 'disabled || null',
121122
},
@@ -181,6 +182,7 @@ export class MatButton extends _MatButtonMixinBase
181182
@Component({
182183
moduleId: module.id,
183184
selector: `a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab]`,
185+
exportAs: 'matButton, matAnchor',
184186
host: {
185187
'[attr.tabindex]': 'disabled ? -1 : 0',
186188
'[attr.disabled]': 'disabled || null',

src/lib/card/card.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export class MatCardSubtitle {}
5555
*/
5656
@Directive({
5757
selector: 'mat-card-actions',
58+
exportAs: 'matCardActions',
5859
host: {
5960
'class': 'mat-card-actions',
6061
'[class.mat-card-actions-align-end]': 'align === "end"',
@@ -150,6 +151,7 @@ export class MatCardAvatar {}
150151
@Component({
151152
moduleId: module.id,
152153
selector: 'mat-card',
154+
exportAs: 'matCard',
153155
templateUrl: 'card.html',
154156
styleUrls: ['card.css'],
155157
encapsulation: ViewEncapsulation.None,

src/lib/checkbox/checkbox.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export const _MatCheckboxMixinBase =
9898
selector: 'mat-checkbox',
9999
templateUrl: 'checkbox.html',
100100
styleUrls: ['checkbox.css'],
101+
exportAs: 'matCheckbox',
101102
host: {
102103
'class': 'mat-checkbox',
103104
'[id]': 'id',

src/lib/chips/chip-input.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export interface MatChipInputEvent {
2323
*/
2424
@Directive({
2525
selector: 'input[matChipInputFor]',
26+
exportAs: 'matChipInput, matChipInputFor',
2627
host: {
2728
'class': 'mat-chip-input mat-input-element',
2829
'(keydown)': '_keydown($event)',

src/lib/core/option/optgroup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ let _uniqueOptgroupIdCounter = 0;
2323
@Component({
2424
moduleId: module.id,
2525
selector: 'mat-optgroup',
26+
exportAs: 'matOptgroup',
2627
templateUrl: 'optgroup.html',
2728
encapsulation: ViewEncapsulation.None,
2829
preserveWhitespaces: false,

0 commit comments

Comments
 (0)