Last active
June 16, 2020 15:27
-
-
Save lydemann/cc75ed07f934aa4051c848400e7e228f to your computer and use it in GitHub Desktop.
crud-item.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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