diff --git a/src/cdk-experimental/popover-edit/popover-edit.spec.ts b/src/cdk-experimental/popover-edit/popover-edit.spec.ts index 20d1473670ed..18254609761a 100644 --- a/src/cdk-experimental/popover-edit/popover-edit.spec.ts +++ b/src/cdk-experimental/popover-edit/popover-edit.spec.ts @@ -61,10 +61,7 @@ interface PeriodicElement { weight: number; } -@Directive({ - // TODO(devversion): this selector can be removed when we update to Angular 9.0. - selector: 'do-not-use-abstract-cdk-popover-edit-base-test-component' -}) +@Directive() abstract class BaseTestComponent { @ViewChild('table', {static: false}) table: ElementRef; diff --git a/src/material-experimental/mdc-button/button-base.ts b/src/material-experimental/mdc-button/button-base.ts index 6b59908d66a1..8763563fe81b 100644 --- a/src/material-experimental/mdc-button/button-base.ts +++ b/src/material-experimental/mdc-button/button-base.ts @@ -79,10 +79,7 @@ export const _MatButtonBaseMixin: CanDisableRippleCtor&CanDisableCtor&CanColorCt typeof MatButtonMixinCore = mixinColor(mixinDisabled(mixinDisableRipple(MatButtonMixinCore))); /** Base class for all buttons. */ -@Directive({ - // TODO(devversion): this selector can be removed when we update to Angular 9.0. - selector: 'do-not-use-abstract-mat-button-base' -}) +@Directive() export class MatButtonBase extends _MatButtonBaseMixin implements CanDisable, CanColor, CanDisableRipple { /** The ripple animation configuration to use for the buttons. */ @@ -154,10 +151,7 @@ export const MAT_ANCHOR_HOST = { /** * Anchor button base. */ -@Directive({ - // TODO(devversion): this selector can be removed when we update to Angular 9.0. - selector: 'do-not-use-abstract-mat-anchor-base' -}) +@Directive() export class MatAnchorBase extends MatButtonBase { tabIndex: number; diff --git a/src/material-experimental/mdc-button/module.ts b/src/material-experimental/mdc-button/module.ts index 06ee59d3cb56..e78a783ea55e 100644 --- a/src/material-experimental/mdc-button/module.ts +++ b/src/material-experimental/mdc-button/module.ts @@ -10,7 +10,6 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {MatCommonModule, MatRippleModule} from '@angular/material/core'; import {MatAnchor, MatButton} from './button'; -import {MatAnchorBase, MatButtonBase} from './button-base'; import {MatFabAnchor, MatFabButton} from './fab'; import {MatIconAnchor, MatIconButton} from './icon-button'; @@ -32,10 +31,6 @@ import {MatIconAnchor, MatIconButton} from './icon-button'; MatIconButton, MatFabAnchor, MatFabButton, - // TODO(devversion): remove when `MatButtonBase` becomes a selectorless Directive. - MatButtonBase, - // TODO(devversion): remove when `MatAnchorBase` becomes a selectorless Directive. - MatAnchorBase, ], }) export class MatButtonModule { diff --git a/src/material-experimental/popover-edit/popover-edit.spec.ts b/src/material-experimental/popover-edit/popover-edit.spec.ts index c48f6714f050..623411cd9a5a 100644 --- a/src/material-experimental/popover-edit/popover-edit.spec.ts +++ b/src/material-experimental/popover-edit/popover-edit.spec.ts @@ -59,10 +59,7 @@ interface PeriodicElement { weight: number; } -@Directive({ - // TODO(devversion): this selector can be removed when we update to Angular 9.0. - selector: 'do-not-use-abstract-mat-popover-edit-base-test-component' -}) +@Directive() abstract class BaseTestComponent { @ViewChild('table', {static: false}) table: ElementRef; diff --git a/src/material/form-field/form-field-control.ts b/src/material/form-field/form-field-control.ts index 14fa97ec2efc..627ce45163fb 100644 --- a/src/material/form-field/form-field-control.ts +++ b/src/material/form-field/form-field-control.ts @@ -12,12 +12,7 @@ import {Directive} from '@angular/core'; /** An interface which allows a control to work inside of a `MatFormField`. */ -@Directive({ - // The @Directive with selector is required here because we're still running a lot of things - // against ViewEngine where directives without selectors are not allowed. - // TODO(crisbeto): convert to a selectorless Directive after we switch to Ivy. - selector: 'do-not-use-abstract-mat-form-field-control', -}) +@Directive() export abstract class MatFormFieldControl { /** The value of the control. */ value: T | null; diff --git a/src/material/form-field/form-field-module.ts b/src/material/form-field/form-field-module.ts index c7363ea75743..f24eaa11eee6 100644 --- a/src/material/form-field/form-field-module.ts +++ b/src/material/form-field/form-field-module.ts @@ -16,8 +16,6 @@ import {MatLabel} from './label'; import {MatPlaceholder} from './placeholder'; import {MatPrefix} from './prefix'; import {MatSuffix} from './suffix'; -import {MatFormFieldControl} from './form-field-control'; - @NgModule({ declarations: [ @@ -28,10 +26,6 @@ import {MatFormFieldControl} from './form-field-control'; MatPlaceholder, MatPrefix, MatSuffix, - - // TODO(crisbeto): can be removed once `MatFormFieldControl` - // is turned into a selector-less directive. - MatFormFieldControl as any, ], imports: [ CommonModule, diff --git a/src/material/menu/menu-module.ts b/src/material/menu/menu-module.ts index a338ed968dbb..170990d0dd18 100644 --- a/src/material/menu/menu-module.ts +++ b/src/material/menu/menu-module.ts @@ -10,13 +10,10 @@ import {OverlayModule} from '@angular/cdk/overlay'; import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {MatCommonModule, MatRippleModule} from '@angular/material/core'; +import {_MatMenu} from './menu'; import {MatMenuContent} from './menu-content'; -import {_MatMenu, _MatMenuBase, MatMenu} from './menu'; import {MatMenuItem} from './menu-item'; -import { - MatMenuTrigger, - MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER, -} from './menu-trigger'; +import {MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER, MatMenuTrigger,} from './menu-trigger'; /** * Used by both the current `MatMenuModule` and the MDC `MatMenuModule` @@ -27,10 +24,6 @@ import { declarations: [ MatMenuTrigger, MatMenuContent, - // TODO(devversion): remove when `MatMenu` becomes a selectorless Directive. - MatMenu, - // TODO(devversion): remove when `_MatMenuBase` becomes a selectorless Directive. - _MatMenuBase ], providers: [MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER] }) diff --git a/src/material/menu/menu.ts b/src/material/menu/menu.ts index 4ecb6c2d9779..952265a2b91d 100644 --- a/src/material/menu/menu.ts +++ b/src/material/menu/menu.ts @@ -93,10 +93,7 @@ const MAT_MENU_BASE_ELEVATION = 4; let menuPanelUid = 0; /** Base class with all of the `MatMenu` functionality. */ -@Directive({ - // TODO(devversion): this selector can be removed when we update to Angular 9.0. - selector: 'do-not-use-abstract-mat-menu-base' -}) +@Directive() // tslint:disable-next-line:class-name export class _MatMenuBase implements AfterContentInit, MatMenuPanel, OnInit, OnDestroy { @@ -454,10 +451,7 @@ export class _MatMenuBase implements AfterContentInit, MatMenuPanel } /** @docs-private We show the "_MatMenu" class as "MatMenu" in the docs. */ -@Directive({ - // TODO(devversion): this selector can be removed when we update to Angular 9.0. - selector: 'do-not-use-abstract-mat-menu' -}) +@Directive() export class MatMenu extends _MatMenuBase {} // Note on the weird inheritance setup: we need three classes, because the MDC-based menu has to diff --git a/src/material/tabs/paginated-tab-header.ts b/src/material/tabs/paginated-tab-header.ts index 3c63f1e37854..7da835e2df24 100644 --- a/src/material/tabs/paginated-tab-header.ts +++ b/src/material/tabs/paginated-tab-header.ts @@ -68,10 +68,7 @@ export type MatPaginatedTabHeaderItem = FocusableOption & {elementRef: ElementRe * Base class for a tab header that supported pagination. * @docs-private */ -@Directive({ - // TODO(crisbeto): this selector can be removed when we update to Angular 9.0. - selector: 'do-not-use-abstract-mat-paginated-tab-header' -}) +@Directive() export abstract class MatPaginatedTabHeader implements AfterContentChecked, AfterContentInit, AfterViewInit, OnDestroy { abstract _items: QueryList; diff --git a/src/material/tabs/tab-body.ts b/src/material/tabs/tab-body.ts index 74cd829efb4b..b7c057e4c7c7 100644 --- a/src/material/tabs/tab-body.ts +++ b/src/material/tabs/tab-body.ts @@ -102,10 +102,7 @@ export class MatTabBodyPortal extends CdkPortalOutlet implements OnInit, OnDestr * Base class with all of the `MatTabBody` functionality. * @docs-private */ -@Directive({ - // TODO(crisbeto): this selector can be removed when we update to Angular 9.0. - selector: 'do-not-use-abstract-mat-tab-body-base' -}) +@Directive() // tslint:disable-next-line:class-name export abstract class _MatTabBodyBase implements OnInit, OnDestroy { /** Current position of the tab-body in the tab-group. Zero means that the tab is visible. */ diff --git a/src/material/tabs/tab-group.ts b/src/material/tabs/tab-group.ts index 692ccfc4d2a3..1d3a96d589c0 100644 --- a/src/material/tabs/tab-group.ts +++ b/src/material/tabs/tab-group.ts @@ -88,10 +88,7 @@ interface MatTabGroupBaseHeader { * Base class with all of the `MatTabGroupBase` functionality. * @docs-private */ -@Directive({ - // TODO(crisbeto): this selector can be removed when we update to Angular 9.0. - selector: 'do-not-use-abstract-mat-tab-group-base' -}) +@Directive() // tslint:disable-next-line:class-name export abstract class _MatTabGroupBase extends _MatTabGroupMixinBase implements AfterContentInit, AfterContentChecked, OnDestroy, CanColor, CanDisableRipple { diff --git a/src/material/tabs/tab-header.ts b/src/material/tabs/tab-header.ts index 61c3c5601c5b..2a7094ffd639 100644 --- a/src/material/tabs/tab-header.ts +++ b/src/material/tabs/tab-header.ts @@ -38,10 +38,7 @@ import {MatPaginatedTabHeader} from './paginated-tab-header'; * Base class with all of the `MatTabHeader` functionality. * @docs-private */ -@Directive({ - // TODO(crisbeto): this selector can be removed when we update to Angular 9.0. - selector: 'do-not-use-abstract-mat-tab-header-base' -}) +@Directive() // tslint:disable-next-line:class-name export abstract class _MatTabHeaderBase extends MatPaginatedTabHeader implements AfterContentChecked, AfterContentInit, AfterViewInit, OnDestroy { diff --git a/src/material/tabs/tab-nav-bar/tab-nav-bar.ts b/src/material/tabs/tab-nav-bar/tab-nav-bar.ts index 4780f6f24f63..2f3f13ee34da 100644 --- a/src/material/tabs/tab-nav-bar/tab-nav-bar.ts +++ b/src/material/tabs/tab-nav-bar/tab-nav-bar.ts @@ -52,10 +52,7 @@ import {startWith, takeUntil} from 'rxjs/operators'; * Base class with all of the `MatTabNav` functionality. * @docs-private */ -@Directive({ - // TODO(crisbeto): this selector can be removed when we update to Angular 9.0. - selector: 'do-not-use-abstract-mat-tab-nav-base' -}) +@Directive() // tslint:disable-next-line:class-name export abstract class _MatTabNavBase extends MatPaginatedTabHeader implements AfterContentChecked, AfterContentInit, OnDestroy { @@ -192,10 +189,7 @@ const _MatTabLinkMixinBase: mixinTabIndex(mixinDisableRipple(mixinDisabled(MatTabLinkMixinBase))); /** Base class with all of the `MatTabLink` functionality. */ -@Directive({ - // TODO(crisbeto): this selector can be removed when we update to Angular 9.0. - selector: 'do-not-use-abstract-mat-tab-link-base' -}) +@Directive() // tslint:disable-next-line:class-name export class _MatTabLinkBase extends _MatTabLinkMixinBase implements OnDestroy, CanDisable, CanDisableRipple, HasTabIndex, RippleTarget, FocusableOption { diff --git a/src/material/tabs/tabs-module.ts b/src/material/tabs/tabs-module.ts index 70668b6fd815..fa6d760573ca 100644 --- a/src/material/tabs/tabs-module.ts +++ b/src/material/tabs/tabs-module.ts @@ -6,22 +6,21 @@ * found in the LICENSE file at https://angular.io/license */ +import {A11yModule} from '@angular/cdk/a11y'; import {ObserversModule} from '@angular/cdk/observers'; import {PortalModule} from '@angular/cdk/portal'; import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; -import {A11yModule} from '@angular/cdk/a11y'; import {MatCommonModule, MatRippleModule} from '@angular/material/core'; import {MatInkBar} from './ink-bar'; import {MatTab} from './tab'; -import {MatTabBody, MatTabBodyPortal, _MatTabBodyBase} from './tab-body'; +import {MatTabBody, MatTabBodyPortal} from './tab-body'; import {MatTabContent} from './tab-content'; -import {MatTabGroup, _MatTabGroupBase} from './tab-group'; -import {MatTabHeader, _MatTabHeaderBase} from './tab-header'; +import {MatTabGroup} from './tab-group'; +import {MatTabHeader} from './tab-header'; import {MatTabLabel} from './tab-label'; import {MatTabLabelWrapper} from './tab-label-wrapper'; -import {MatTabLink, MatTabNav, _MatTabNavBase, _MatTabLinkBase} from './tab-nav-bar/tab-nav-bar'; -import {MatPaginatedTabHeader} from './paginated-tab-header'; +import {MatTabLink, MatTabNav} from './tab-nav-bar/tab-nav-bar'; @NgModule({ @@ -55,14 +54,6 @@ import {MatPaginatedTabHeader} from './paginated-tab-header'; MatTabBodyPortal, MatTabHeader, MatTabContent, - - // TODO(crisbeto): these can be removed once they're turned into selector-less directives. - MatPaginatedTabHeader as any, - _MatTabGroupBase as any, - _MatTabNavBase as any, - _MatTabBodyBase as any, - _MatTabHeaderBase as any, - _MatTabLinkBase as any, ], }) export class MatTabsModule {}