Skip to content

Commit 7f6afd6

Browse files
committed
fix(snackbar): wrap simple snackbar text in span
We have begun transforming our html templates in our internal syncs to include our license header which results in a new line above template. In the simple snack bar this adds a single space when looking at the elements textContent. By wrapping the content in a span we ensure that the whitespace is consistent regardless of the presence of the license header comment in the template file.
1 parent d5c5f31 commit 7f6afd6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/demo-app/demo-app/demo-app.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import {OverlayContainer} from '@angular/cdk/overlay';
1010
import {Component, ElementRef, ViewEncapsulation} from '@angular/core';
11+
import {Location} from '@angular/common';
1112

1213

1314
/**
@@ -97,7 +98,10 @@ export class DemoApp {
9798

9899
constructor(
99100
private _element: ElementRef,
100-
private _overlayContainer: OverlayContainer) {}
101+
private _overlayContainer: OverlayContainer,
102+
location: Location) {
103+
location.subscribe(console.log);
104+
}
101105

102106
toggleFullscreen() {
103107
const elem = this._element.nativeElement.querySelector('.demo-content');
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{{data.message}}
2-
1+
<span>{{data.message}}</span>
32
<div class="mat-simple-snackbar-action" *ngIf="hasAction">
43
<button mat-button (click)="action()">{{data.action}}</button>
54
</div>

0 commit comments

Comments
 (0)