I am using angular2-image-upload
module for upload my image in my project and I used this code:
<image-upload
[max]="100"
[url]="'example.com/images/upload'"
[headers]="{header: 'Authorization', value: 'MyToken'}"
[buttonCaption]="'Select Images!'"
[dropBoxMessage]="'Drop your images here!'"
[extensions]="['jpg','png','gif']"
(onFileUploadFinish)="imageUploaded($event)"
(onRemove)="imageRemoved($event)"
(isPending)="disableSendButton($event)"
></image-upload>
but I get below error :
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.
and in the end , the image is uploded (status code : 200 in network tab in chrome browser) but I don't recieve any response from server.
How can I solved this problem?