2017-08-06 10:42:37 +02:00
|
|
|
import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core";
|
|
|
|
import {War} from "../../models/model-interfaces";
|
|
|
|
import {LoginService} from "../../services/login-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();
|
|
|
|
|
2017-10-08 12:17:21 +02:00
|
|
|
constructor(public loginService: LoginService) {
|
2017-08-06 10:42:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
}
|
|
|
|
|
|
|
|
select() {
|
|
|
|
this.warSelected.emit(this.war._id)
|
|
|
|
}
|
|
|
|
|
|
|
|
delete() {
|
|
|
|
this.warDelete.emit(this.war);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|