ng2-fancy-image-uploader icon indicating copy to clipboard operation
ng2-fancy-image-uploader copied to clipboard

Display initial image

Open GeekyMonkey opened this issue 6 years ago • 7 comments

I want to use this on a form where the user may have already uploaded an image previously. So they're not adding an image, but they can replace the image. Is it possible with this control to display that initial image instead of the empty box with the "add" text?

GeekyMonkey avatar Mar 05 '18 17:03 GeekyMonkey

If you are using reactive forms then it is possible to specify: formControlName="imageUrl".

ogix avatar Mar 06 '18 10:03 ogix

How can i implement this?

formControlName="imageUrl" ?

joaolori avatar Mar 16 '18 12:03 joaolori

Can u provide example for this @ogix

joaolori avatar Mar 17 '18 02:03 joaolori

@GeekyMonkey Did you figure this out

enyachoke avatar May 22 '18 17:05 enyachoke

No. Sorry. I gave up on this control and rolled my own. It wasn't a great fit for my use anyway.

GeekyMonkey avatar May 22 '18 21:05 GeekyMonkey

Anyway if somebody needs it

 public fileControl = new FormControl();
 ngOnInit() {

        this.fileControl.setValue('url', { emitEvent: false});
      
    }
<fancy-image-uploader id="field_photoUrl" name="photoUrl"  [formControl]="fileControl"  [options]="options" (onUpload)="onUpload($event)"></fancy-image-uploader>

enyachoke avatar May 23 '18 12:05 enyachoke

i try from @enyachoke suggestion. it does not working. I got some error. Can you help me to fix?

screen shot 2018-06-23 at 00 07 02 screen shot 2018-06-23 at 00 06 42

jirapatj avatar Jun 22 '18 17:06 jirapatj