Second use of input file doesn't trigger onchange anymore

前端 未结 8 1405
旧巷少年郎
旧巷少年郎 2020-12-25 11:55

I have a picture upload button that automatically uploads the file when selected from the browse window.
Nonetheless, it doesn\'t work the second time around and that is

8条回答
  •  北海茫月
    2020-12-25 12:33

    In angular

    HTML

     
    

    TS

    export class SomeComponent {
    
     @ViewChild('photoInput') photoInput;
    
     clearPictureAttachment() {
      this.photoInput.nativeElement.value = '';
     }
    }
    

提交回复
热议问题