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

43 lines
900 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: 'cc-war-item',
templateUrl: './war-item.component.html',
styleUrls: ['./war-item.component.css'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class WarItemComponent implements OnInit {
@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);
}
}