opt-cc/static/src/app/statistic/war-list/war-item.component.ts

39 lines
821 B
TypeScript

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