ucap-doc/documents/업무/6월/1째주/backup/etc/room-list-item-02.component.ts

64 lines
1.1 KiB
TypeScript
Raw Permalink Normal View History

2020-06-05 09:45:18 +00:00
import {
Component,
OnInit,
ChangeDetectionStrategy,
Input,
OnDestroy,
EventEmitter,
Output,
ChangeDetectorRef
} from '@angular/core';
import { RoomInfo, RoomType } from '@ucap/protocol-room';
@Component({
selector: 'ucap-chat-room-list-item-02',
templateUrl: './room-list-item-02.component.html',
styleUrls: ['./room-list-item-02.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class RoomListItem02Component implements OnInit, OnDestroy {
@Input()
roomInfo: RoomInfo;
@Input()
profileImageRoot: string;
@Input()
defaultProfileImage: string;
@Input()
profileImage: string;
@Input()
roomName: string;
@Input()
checkable = false;
@Input()
checked = false;
@Output()
toggleItem = new EventEmitter<{
checked: boolean;
roomInfo: RoomInfo;
}>();
RoomType = RoomType;
constructor(private changeDetectorRef: ChangeDetectorRef) {}
ngOnInit(): void {}
ngOnDestroy(): void {}
onToggleItem(value: boolean): void {
this.toggleItem.emit({
checked: value,
roomInfo: this.roomInfo
});
this.changeDetectorRef.detectChanges();
}
}