Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
crud-item.component.ts
@Component({
selector: 'app-crud-item',
templateUrl: './crud-item.component.html',
styleUrls: ['./crud-item.component.scss'],
})
export class CrudItemComponent {
@Input() public todoItem: TodoItem;
@Input() public isReadOnly: boolean;
@Input() public dueDateText: string = 'add-todo.due-date';
@Input() public completeBtnText: string = 'todo-item.complete';
@Input() public editBtnText: string = 'todo-item.edit';
@Input() public deleteBtnText: string = 'todo-item.delete';
@Output() public todoDelete = new EventEmitter();
@Output() public todoEdit = new EventEmitter();
@Output() public todoCompleteToggled = new EventEmitter<string>();
public completeClick() {
this.todoCompleteToggled.emit(this.todoItem.id);
}
public deleteClick() {
this.todoDelete.emit(this.todoItem.id);
}
public editClick() {
this.todoEdit.emit(this.todoItem);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.