import {ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; import {War} from '../../../models/model-interfaces'; import {LoginService} from '../../../services/app-user-service/login-service'; @Component({ selector: 'cc-war-item', templateUrl: './war-item.component.html', styleUrls: ['./war-item.component.css'], changeDetection: ChangeDetectionStrategy.OnPush }) export class WarItemComponent implements OnInit { @Input() collapsed: boolean; @Input() selected: boolean; @Input() war: War; @Output() warSelected = new EventEmitter(); @Output() warEdit = new EventEmitter(); @Output() warDelete = new EventEmitter(); constructor(public loginService: LoginService) { } ngOnInit() { } select() { this.warSelected.emit(this.war._id); } edit() { this.warEdit.emit(this.war._id); } delete() { this.warDelete.emit(this.war); } }