UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

46 lines 4.83 kB
/** * 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 { ChangeDetectionStrategy, Component, ElementRef, Input, ViewEncapsulation } from '@angular/core'; export class NzCardMetaComponent { constructor(elementRef) { this.elementRef = elementRef; this.nzTitle = null; this.nzDescription = null; this.nzAvatar = null; // TODO: move to host after View Engine deprecation this.elementRef.nativeElement.classList.add('ant-card-meta'); } } NzCardMetaComponent.decorators = [ { type: Component, args: [{ selector: 'nz-card-meta', exportAs: 'nzCardMeta', preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: ` <div class="ant-card-meta-avatar" *ngIf="nzAvatar"> <ng-template [ngTemplateOutlet]="nzAvatar"></ng-template> </div> <div class="ant-card-meta-detail" *ngIf="nzTitle || nzDescription"> <div class="ant-card-meta-title" *ngIf="nzTitle"> <ng-container *nzStringTemplateOutlet="nzTitle">{{ nzTitle }}</ng-container> </div> <div class="ant-card-meta-description" *ngIf="nzDescription"> <ng-container *nzStringTemplateOutlet="nzDescription">{{ nzDescription }}</ng-container> </div> </div> ` },] } ]; NzCardMetaComponent.ctorParameters = () => [ { type: ElementRef } ]; NzCardMetaComponent.propDecorators = { nzTitle: [{ type: Input }], nzDescription: [{ type: Input }], nzAvatar: [{ type: Input }] }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FyZC1tZXRhLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIvaG9tZS92c3RzL3dvcmsvMS9zL2NvbXBvbmVudHMvY2FyZC8iLCJzb3VyY2VzIjpbImNhcmQtbWV0YS5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7OztHQUdHO0FBRUgsT0FBTyxFQUFFLHVCQUF1QixFQUFFLFNBQVM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