ng-ytl-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
123 lines (109 loc) • 3.27 kB
text/typescript
import {
Component,
ContentChild,
HostBinding,
Input,
OnInit,
TemplateRef,
ViewEncapsulation,
} from '@angular/core';
import {
animate,
style,
transition,
trigger,
} from '@angular/animations';
import { toBoolean } from '../util/convert';
export class NzBadgeComponent implements OnInit {
private _showDot = false;
private _showZero = false;
count: number;
maxNumberArray;
countArray = [];
countSingleArray = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ];
content: TemplateRef<void>;
get setNoWrapper(): boolean {
return !this.content;
}
nzOverflowCount = 99;
set nzShowZero(value: boolean) {
this._showZero = toBoolean(value);
}
get nzShowZero(): boolean {
return this._showZero;
}
set nzDot(value: boolean) {
this._showDot = toBoolean(value);
}
get nzDot(): boolean {
return this._showDot;
}
nzText: string;
nzStyle;
nzStatus: string;
set nzCount(value: number) {
if (value < 0) {
this.count = 0;
} else {
this.count = value;
}
this.countArray = this.count.toString().split('');
}
get nzCount(): number {
return this.count;
}
ngOnInit(): void {
this.maxNumberArray = this.nzOverflowCount.toString().split('');
}
}