Skip to content

Commit

Permalink
refactor(material/snack-bar): replace left-over module imports with s…
Browse files Browse the repository at this point in the history
…tandalone equivalents
  • Loading branch information
nikos-moysiadis committed Nov 28, 2023
1 parent 0c6993a commit 22dd6ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/material/snack-bar/simple-snack-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
*/

import {ChangeDetectionStrategy, Component, Inject, ViewEncapsulation} from '@angular/core';
import {CommonModule} from '@angular/common';
import {MatButtonModule} from '@angular/material/button';
import {MatButton} from '@angular/material/button';
import {MatSnackBarRef} from './snack-bar-ref';
import {MAT_SNACK_BAR_DATA} from './snack-bar-config';
import {MatSnackBarAction, MatSnackBarActions, MatSnackBarLabel} from './snack-bar-content';
Expand All @@ -30,7 +29,7 @@ export interface TextOnlySnackBar {
exportAs: 'matSnackBar',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [MatButtonModule, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction, CommonModule],
imports: [MatButton, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction],
standalone: true,
host: {
'class': 'mat-mdc-simple-snack-bar',
Expand Down
2 changes: 1 addition & 1 deletion src/material/snack-bar/snack-bar-container.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="mat-mdc-snack-bar-label" #label>
<!-- Initialy holds the snack bar content, will be empty after announcing to screen readers. -->
<div aria-hidden="true">
<ng-template cdkPortalOutlet></ng-template>
<ng-template cdkPortalOutlet />
</div>

<!-- Will receive the snack bar content from the non-live div, move will happen a short delay after opening -->
Expand Down
3 changes: 1 addition & 2 deletions src/material/snack-bar/snack-bar-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
CdkPortalOutlet,
ComponentPortal,
DomPortal,
PortalModule,
TemplatePortal,
} from '@angular/cdk/portal';
import {Observable, Subject} from 'rxjs';
Expand Down Expand Up @@ -54,7 +53,7 @@ let uniqueId = 0;
encapsulation: ViewEncapsulation.None,
animations: [matSnackBarAnimations.snackBarState],
standalone: true,
imports: [PortalModule],
imports: [CdkPortalOutlet],
host: {
'class': 'mdc-snackbar mat-mdc-snack-bar-container mdc-snackbar--open',
'[@state]': '_animationState',
Expand Down

0 comments on commit 22dd6ae

Please sign in to comment.