Skip to content

Commit b9041e3

Browse files
chrisvfabiommalerba
authored andcommitted
fix(nav-schematics): update isHandset$ type and fix template expression (#11448)
Fixes #11445, fixes #11441
1 parent 3fdd2cc commit b9041e3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/lib/schematics/nav/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#drawer
44
class="sidenav"
55
fixedInViewport="true"
6-
[attr.role]="isHandset$ | async ? 'dialog' : 'navigation'"
7-
[mode]="isHandset$ | async ? 'over' : 'side'"
6+
[attr.role]="(isHandset$ | async) ? 'dialog' : 'navigation'"
7+
[mode]="(isHandset$ | async) ? 'over' : 'side'"
88
[opened]="!(isHandset$ | async)">
99
<mat-toolbar color="primary">Menu</mat-toolbar>
1010
<mat-nav-list>

src/lib/schematics/nav/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import { map } from 'rxjs/operators';
1111
#drawer
1212
class="sidenav"
1313
fixedInViewport="true"
14-
[attr.role]="isHandset$ | async ? 'dialog' : 'navigation'"
15-
[mode]="isHandset$ | async ? 'over' : 'side'"
14+
[attr.role]="(isHandset$ | async) ? 'dialog' : 'navigation'"
15+
[mode]="(isHandset$ | async) ? 'over' : 'side'"
1616
[opened]="!(isHandset$ | async)">
1717
<mat-toolbar color="primary">Menu</mat-toolbar>
1818
<mat-nav-list>
@@ -55,7 +55,7 @@ import { map } from 'rxjs/operators';
5555
})
5656
export class <%= classify(name) %>Component {
5757

58-
isHandset$: Observable<BreakpointState> = this.breakpointObserver.observe(Breakpoints.Handset)
58+
isHandset$: Observable<boolean> = this.breakpointObserver.observe(Breakpoints.Handset)
5959
.pipe(
6060
map(result => result.matches)
6161
);

0 commit comments

Comments
 (0)