// If there is only one copyId, then notes may be applied or removed.
@Input() copyIds: number[] = [];
- mode: string; // create | manage
+ mode: string; // create | manage | edit
// If true, no attempt is made to save the new notes to the
// database. It's assumed this takes place in the calling code.
autoId = -1;
+ idToEdit: number;
+
@ViewChild('successMsg', { static: true }) private successMsg: StringComponent;
@ViewChild('errorMsg', { static: true }) private errorMsg: StringComponent;
});
}
+ editNote(note: IdlObject) {
+ this.idToEdit = note.id();
+ this.mode = 'edit';
+ }
+
+ returnToManage() {
+ this.getCopies().then(() => {
+ this.idToEdit = null;
+ this.mode = 'manage';
+ })
+ }
+
removeNote(note: IdlObject) {
this.newNotes = this.newNotes.filter(t => t.id() !== note.id());