Skip to content
Permalink
Browse files

fix(module:tooltip): empty judgement (#3993)

* fix: empty judgement

* fix: remove useless property

* fix(module:popover): fix propertyName

patch #3909
  • Loading branch information...
wendzhue committed Aug 13, 2019
1 parent 4d27fb6 commit a853e96d781a4982ee8e008002b72899362373e1
@@ -45,8 +45,11 @@ import { NzTooltipBaseComponentLegacy, NzToolTipComponent } from 'ng-zorro-antd/
export class NzPopoverComponent extends NzToolTipComponent {
_prefix = 'ant-popover-placement';

@Input() @ContentChild('neverUsedTemplate', { static: true }) nzPopoverTitle: NzTSType;
@Input() @ContentChild('nzTemplate', { static: true }) nzPopoverContent: NzTSType;
/**
* Use `neverUsedTemplate` to force `nzTemplate` to be catched by `nzPopoverContent`.
*/
@Input() @ContentChild('neverUsedTemplate', { static: true }) nzTitle: NzTSType;
@Input() @ContentChild('nzTemplate', { static: true }) nzContent: NzTSType;

constructor(cdr: ChangeDetectorRef, @Host() @Optional() public noAnimation?: NzNoAnimationDirective) {
super(cdr, noAnimation);
@@ -7,18 +7,7 @@
*/

import { CdkConnectedOverlay } from '@angular/cdk/overlay';
import {
ChangeDetectorRef,
ContentChild,
EventEmitter,
Host,
Input,
OnChanges,
Optional,
Output,
TemplateRef,
ViewChild
} from '@angular/core';
import { ChangeDetectorRef, EventEmitter, Host, Input, OnChanges, Optional, Output, ViewChild } from '@angular/core';
import { toBoolean, NgStyleInterface, NzNoAnimationDirective, POSITION_MAP } from 'ng-zorro-antd/core';

import { NzTooltipTrigger } from '../nz-tooltip.definitions';
@@ -42,7 +31,6 @@ import { NzTooltipBaseComponent } from './nz-tooltip-base.component';
export class NzTooltipBaseComponentLegacy extends NzTooltipBaseComponent implements OnChanges {
@ViewChild('overlay', { static: false }) overlay: CdkConnectedOverlay;

@Input() @ContentChild('nzTemplate', { static: true }) contentTitle: string | TemplateRef<void> | null;
@Input() nzOverlayClassName = '';
@Input() nzOverlayStyle: NgStyleInterface = {};
@Input() nzMouseEnterDelay = 0.15; // second
@@ -117,6 +117,6 @@ export abstract class NzTooltipBaseComponent {
}

private isContentEmpty(): boolean {
return this.nzTitle instanceof TemplateRef ? false : this.nzTitle === '' || !isNotNil(this.nzTitle);
return this.nzContent instanceof TemplateRef ? false : this.nzContent === '' || !isNotNil(this.nzContent);
}
}

0 comments on commit a853e96

Please sign in to comment.
You can’t perform that action at this time.