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

37 lines
829 B
TypeScript

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: 'pjm-war-item',
templateUrl: './war-item.component.html',
styleUrls: ['./war-item.component.css', '../../style/list-entry.css'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class WarItemComponent implements OnInit {
@Input() selected: boolean;
@Input() war: War;
@Output() warSelected = new EventEmitter();
@Output() warDelete = new EventEmitter();
constructor(public loginService: LoginService) {
}
ngOnInit() {
}
select() {
this.warSelected.emit(this.war._id);
}
delete() {
this.warDelete.emit(this.war);
}
}