import { Component, ViewEncapsulation, TemplateRef, Input, ContentChild } from '@angular/core'; @Component({ selector: 'chart-card', template: `
{{ _title }} {{ _action }}

`, styleUrls: [ './card.less' ], encapsulation: ViewEncapsulation.Emulated }) export class ChartCardComponent { // region fields _title = ''; _titleTpl: TemplateRef; @Input() set title(value: string | TemplateRef) { if (value instanceof TemplateRef) this._titleTpl = value; else this._title = value; } _action = ''; _actionTpl: TemplateRef; @Input() set action(value: string | TemplateRef) { if (value instanceof TemplateRef) this._actionTpl = value; else this._action = value; } @Input() total = ''; @Input() contentHeight = ''; _footer = ''; _footerTpl: TemplateRef; @Input() set footer(value: string | TemplateRef) { if (value instanceof TemplateRef) this._footerTpl = value; else this._footer = value; } @Input() loading = false; // endregion }