Aaqib
Aaqib

Reputation: 59

How to create endpoint in angular to upload a image?

I have used kolkov angular editor in my angular application to create rich text editor.

Now I want to upload the image from it to the server. I also have the function that takes a file as an argument and sends it to the server.

    uploadImage(file, viewable_type = "Spree::Vendor", viewable_id=null) {
        .............
        .............
        return this.http.post(this.apiV2Url + '/attach_image'+ "?access_token=" + this.accessToken,
        file, options).map(this.extractData).catch(this.handleError);
      }

Now in order to pass the image from editor to the function, I have to give it some endpoint URL.

I want to know how can I create an endpoint API which I can configure with the editor so It can send the file to the uploadImage function.?

Upvotes: 0

Views: 838

Answers (2)

Scius Solution
Scius Solution

Reputation: 1

enter image description here

Angular is a front-end javascript framework. You don't create endpoints to handle server processing in Angular.

Upvotes: 0

Norbert Huurnink
Norbert Huurnink

Reputation: 1316

Angular is a front-end javascript framework. You don't create endpoints to handle server processing in Angular.

Upvotes: 1

Related Questions