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