Skip to content

Commit

Permalink
fix(module:layout): fix sider nzBreakPoint (NG-ZORRO#2665)
Browse files Browse the repository at this point in the history
  • Loading branch information
vthinkxie authored Dec 20, 2018
1 parent bada170 commit 2722320
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/input/nz-autoresize.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '@angular/core';
import { NgControl } from '@angular/forms';
import { fromEvent, Subject } from 'rxjs';
import { auditTime, startWith, takeUntil } from 'rxjs/operators';
import { auditTime, takeUntil } from 'rxjs/operators';

export interface AutoSizeType {
minRows?: number;
Expand Down
5 changes: 3 additions & 2 deletions components/layout/nz-sider.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
import { MediaMatcher } from '@angular/cdk/layout';
import { Platform } from '@angular/cdk/platform';
import { fromEvent, Subject } from 'rxjs';
import { auditTime, startWith, takeUntil } from 'rxjs/operators';
import { auditTime, takeUntil } from 'rxjs/operators';
import { InputBoolean } from '../core/util/convert';
import { NzLayoutComponent } from './nz-layout.component';

Expand Down Expand Up @@ -111,9 +111,10 @@ export class NzSiderComponent implements OnInit, AfterViewInit, OnDestroy {

ngAfterViewInit(): void {
if (this.platform.isBrowser) {
Promise.resolve().then(() => this.watchMatchMedia());
this.ngZone.runOutsideAngular(() => {
fromEvent(window, 'resize')
.pipe(startWith(null), auditTime(16), takeUntil(this.destroy$))
.pipe(auditTime(16), takeUntil(this.destroy$))
.subscribe(() => this.watchMatchMedia());
});
}
Expand Down

0 comments on commit 2722320

Please sign in to comment.