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

45 lines
932 B
TypeScript
Raw Normal View History

2018-03-08 09:44:35 +01:00
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'],
2018-03-08 09:44:35 +01:00
changeDetection: ChangeDetectionStrategy.OnPush
})
2018-03-08 09:44:35 +01:00
export class WarItemComponent implements OnInit {
2018-07-30 20:43:47 +02:00
@Input() collapsed: boolean;
2018-03-08 09:44:35 +01:00
@Input() selected: boolean;
2018-03-08 09:44:35 +01:00
@Input() war: War;
2018-03-08 09:44:35 +01:00
@Output() warSelected = new EventEmitter();
2018-04-29 11:12:09 +02:00
@Output() warEdit = new EventEmitter();
2018-03-08 09:44:35 +01:00
@Output() warDelete = new EventEmitter();
constructor(public loginService: LoginService) {
}
ngOnInit() {
}
select() {
2018-03-08 09:44:35 +01:00
this.warSelected.emit(this.war._id);
}
2018-04-29 11:12:09 +02:00
edit() {
this.warEdit.emit(this.war._id);
}
delete() {
this.warDelete.emit(this.war);
}
}