Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass the url to uploadedfiles attribute from component to render in edit screen #204

Open
agnaveen opened this issue May 17, 2018 · 4 comments

Comments

@agnaveen
Copy link

Hi,

I have uploaded the image in add screen to my server by specifying the server endpoint url in [url] attribute of image-upload. When I try to show the same image in my edit screen, If I put the complete url in [uploadedfiles] attribute then it is rendering properly. But If I pass the same url from component and try to render I am getting totally different behaviours like so many 404 urls generated in the console and also so many empty preview boxes appears in the UI.

The ways I tried is,
Way 1:
$storeLogoUrl -> Passing the name of the store from component.
uploadedFiles="http://localhost:19999/store/logo/{{$storeLogoUrl}}"

Way 2:
uploadedFiles="'http://localhost:19999/store/logo/'+$storeLogoUrl"

Way 3:
[uploadedFiles]="'http://localhost:19999/store/logo/'+$storeLogoUrl"

Way 4:
$storeLogoUrl - Full url I sent from controller itself.
[uploadedFiles]="$storeLogoUrl"

Nothing worked out so far.

Can someone help me out here ?

@agnaveen
Copy link
Author

Finally by specifying like this [uploadedFiles]="[storeLogoUrl]" I am able to see the image in the preview in edit screen.
But still one more image preview empty box is appearing.....

@monis01
Copy link

monis01 commented May 25, 2018

Facing exactly the same issue. It gives one extra <div> (so temporarily used jQuery to hide the above div)
$($('.img-ul-container').children(':first-child')).hide()

screenshot from 2018-05-25 14-52-41

@bolota
Copy link

bolota commented Jun 2, 2018

@agnaveen @monis01
if you want to fix this issue add a ternary:
[uploadedFiles]="image? [image]: ''"

@agnaveen
Copy link
Author

It works for me, thanks a lot @bolota

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants