39 lines
917 B
TypeScript
39 lines
917 B
TypeScript
|
import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core";
|
||
|
import {Router} from "@angular/router";
|
||
|
import {Squad, User} from "../../models/model-interfaces";
|
||
|
|
||
|
@Component({
|
||
|
selector: 'pjm-squad-item',
|
||
|
templateUrl: './squad-item.component.html',
|
||
|
styleUrls: ['./squad-item.component.css'],
|
||
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||
|
inputs: ['squad', 'selected'],
|
||
|
outputs: ['squadSelected', 'squadDelete'],
|
||
|
})
|
||
|
export class SquadItemComponent {
|
||
|
|
||
|
selected: boolean;
|
||
|
squad: Squad;
|
||
|
|
||
|
squadSelected = new EventEmitter();
|
||
|
squadDelete = new EventEmitter();
|
||
|
|
||
|
constructor(private router: Router) {
|
||
|
|
||
|
}
|
||
|
|
||
|
select() {
|
||
|
this.squadSelected.emit(this.squad._id)
|
||
|
}
|
||
|
|
||
|
delete() {
|
||
|
this.squadDelete.emit(this.squad);
|
||
|
}
|
||
|
|
||
|
ngAfterViewChecked() {
|
||
|
//var taskId = (this.task ? this.task.id : '');
|
||
|
// console.log(`Task ${taskId} checked ${++this.checkCounter} times`)
|
||
|
}
|
||
|
}
|
||
|
|