[Sprint/HipsterHedgehog] (feat): ability to copy and paste images into posts and comments
closes minds#553
1/3 discussions resolved
- Resolved by Marcelo Rivera
134 146 this.triedToPost = false; 135 file.value = null; 136 147 this.detectChanges(); 137 148 }) 138 149 .catch(e => { 139 150 console.error(e); 140 151 this.canPost = true; 141 152 this.triedToPost = false; 142 file.value = null; 143 153 this.detectChanges(); 144 154 }); 145 146 this.detectChanges(); 147 155 } 148 156 149 157 removeAttachment(file: HTMLInputElement) { - Maintainer
Can we name this something more specific like ```fileElement``? My dumb brain keeps reading that as an input stream
1 import { Directive, EventEmitter, HostListener, Output } from '@angular/core'; 2 3 @Directive({ selector: '[m-attachment-paste]' }) 4 export class AttachmentPasteDirective { 5 @Output('onFilePaste') onFilePaste: EventEmitter<File> = new EventEmitter<File>(); 6 7 private focused: boolean = false; 8 9 10 @HostListener('focus') onFocus() { 11 this.focused = true; 12 } 13 - Maintainer
This feels like it should be unit tested and also a total pain in the ass to test.