diff --git a/components/drawer/demo/basic-right.ts b/components/drawer/demo/basic-right.ts index 0049fcafa3..69a69d9609 100755 --- a/components/drawer/demo/basic-right.ts +++ b/components/drawer/demo/basic-right.ts @@ -5,9 +5,11 @@ import { Component } from '@angular/core'; template: ` -

Some contents...

-

Some contents...

-

Some contents...

+ +

Some contents...

+

Some contents...

+

Some contents...

+
` }) diff --git a/components/drawer/demo/from-drawer.ts b/components/drawer/demo/from-drawer.ts index 64940b1e24..0d741f8627 100755 --- a/components/drawer/demo/from-drawer.ts +++ b/components/drawer/demo/from-drawer.ts @@ -13,7 +13,7 @@ import { Component } from '@angular/core'; [nzFooter]="footerTpl" (nzOnClose)="close()" > -
+
@@ -80,14 +80,14 @@ import { Component } from '@angular/core';
- - -
- - -
-
+ + +
+ + +
+
` }) diff --git a/components/drawer/demo/multi-level-drawer.ts b/components/drawer/demo/multi-level-drawer.ts index e9ded2f578..49aa5cdb5f 100755 --- a/components/drawer/demo/multi-level-drawer.ts +++ b/components/drawer/demo/multi-level-drawer.ts @@ -12,7 +12,7 @@ import { Component } from '@angular/core'; nzTitle="Cookbook" (nzOnClose)="close()" > -
+
@@ -37,7 +37,7 @@ import { Component } from '@angular/core';
- + diff --git a/components/drawer/demo/placement.ts b/components/drawer/demo/placement.ts index bc3dd23c3f..a5048367c5 100755 --- a/components/drawer/demo/placement.ts +++ b/components/drawer/demo/placement.ts @@ -12,9 +12,11 @@ import { NzDrawerPlacement } from 'ng-zorro-antd/drawer'; -

Some contents...

-

Some contents...

-

Some contents...

+ +

Some contents...

+

Some contents...

+

Some contents...

+
` }) diff --git a/components/drawer/demo/user-profile.ts b/components/drawer/demo/user-profile.ts index 5c508c3419..749c7bfc00 100755 --- a/components/drawer/demo/user-profile.ts +++ b/components/drawer/demo/user-profile.ts @@ -22,37 +22,37 @@ import { Component } from '@angular/core';
-

User Profile

- - Lily - AntDesign@example.com - HangZhou - China🇨🇳 - February 2,1900 - - - - Make things as simple as possible but no simpler. - - - - - Programmer - Coding - AFX - Lin - - C / C + +, data structures, software engineering, operating systems, computer networks, databases, compiler theory, computer - architecture, Microcomputer Principle and Interface Technology, Computer English, Java, ASP, etc. - - - - - AntDesign@example.com - +86 181 0000 0000 - - github.com/NG-ZORRO/ng-zorro-antd - - + +

User Profile

+ + Lily + AntDesign@example.com + HangZhou + China🇨🇳 + February 2,1900 + - + Make things as simple as possible but no simpler. + + + + Programmer + Coding + AFX + Lin + + C / C + +, data structures, software engineering, operating systems, computer networks, databases, compiler theory, computer + architecture, Microcomputer Principle and Interface Technology, Computer English, Java, ASP, etc. + + + + + AntDesign@example.com + +86 181 0000 0000 + + github.com/NG-ZORRO/ng-zorro-antd + + +
`, styles: [ diff --git a/components/drawer/drawer-content.directive.ts b/components/drawer/drawer-content.directive.ts new file mode 100644 index 0000000000..b0cacc51fa --- /dev/null +++ b/components/drawer/drawer-content.directive.ts @@ -0,0 +1,15 @@ +/** + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE + */ + +import { Directive, TemplateRef } from '@angular/core'; +import { NzSafeAny } from 'ng-zorro-antd/core/types'; + +@Directive({ + selector: '[nzDrawerContent]', + exportAs: 'nzDrawerContent' +}) +export class NzDrawerContentDirective { + constructor(public templateRef: TemplateRef) {} +} diff --git a/components/drawer/drawer.component.ts b/components/drawer/drawer.component.ts index 3117dbf304..12a628bef7 100644 --- a/components/drawer/drawer.component.ts +++ b/components/drawer/drawer.component.ts @@ -9,10 +9,12 @@ import { Overlay, OverlayConfig, OverlayKeyboardDispatcher, OverlayRef } from '@ import { CdkPortalOutlet, ComponentPortal, TemplatePortal } from '@angular/cdk/portal'; import { DOCUMENT } from '@angular/common'; import { + AfterContentInit, AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, + ContentChild, EventEmitter, Inject, Injector, @@ -29,12 +31,16 @@ import { ViewChild, ViewContainerRef } from '@angular/core'; + +import { Observable, Subject } from 'rxjs'; +import { takeUntil } from 'rxjs/operators'; + import { NzConfigKey, NzConfigService, WithConfig } from 'ng-zorro-antd/core/config'; +import { warnDeprecation } from 'ng-zorro-antd/core/logger'; import { BooleanInput, NgStyleInterface, NzSafeAny } from 'ng-zorro-antd/core/types'; import { InputBoolean, toCssPixel } from 'ng-zorro-antd/core/util'; -import { Observable, Subject } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; +import { NzDrawerContentDirective } from './drawer-content.directive'; import { NzDrawerOptionsOfComponent, NzDrawerPlacement } from './drawer-options'; import { NzDrawerRef } from './drawer-ref'; @@ -82,10 +88,17 @@ const NZ_CONFIG_MODULE_NAME: NzConfigKey = 'drawer';
- - + + + + - + + + + + +