import { Component, Input, Output, EventEmitter, HostListener, HostBinding, ViewEncapsulation } from '@angular/core'; import { NoticeItem } from './notice-item'; @Component({ selector: 'notice-icon', template: `
{{i.title}}
`, styleUrls: [ './notice-icon.less' ], encapsulation: ViewEncapsulation.None }) export class NoticeIconComponent { @Input() data: NoticeItem[] = []; @Input() count = 0; @Input() loading = false; @Output() select = new EventEmitter(); @Output() clear = new EventEmitter(); @Input() popoverVisible = false; @Output() popupVisibleChange = new EventEmitter(); @HostListener('click') _click() { } onVisibleChange(result: boolean) { this.popupVisibleChange.emit(result); } onSelect(i: any) { this.select.emit(i); } onClear(title: string) { this.clear.emit(title); } }