Example 1 - Running with default configuration (requirement: v0.1.1 and above)

Current value of foo is: {{foo}}. (Works with the active $scope.)


Button is disabled during upload, by default. (See Example 2 to change this).

Server Response: {{uploadResponse}}

Example 2 - Using Options: uploadOptionsEnableControls option (requirement: v0.1.1 and above)

Add or remove this option to enable or disable the submit control(s) during file upload, respectively.
Note that this can also be written as:
  • upload-options-enable-controls; or
  • uploadOptionsEnableControls
It is absent by default; hence, submit controls(s) will be disabled while upload is in progress. In this example, uploadOptionsEnableButtons is present or set, which means the submit button will be enabled during the upload.


Server Response: {{uploadResponse}}

Example 3 - Submitting forms with any html element (requirement: v0.1.1 and above)

This examples show how to use any html element to submit your form. It makes use of a 'div', an 'a', and an 'img' tags to submit the same form.

With a div
Server Response: {{uploadResponse}}

Example 4 - Processing Callback Function Contents (requirement: v0.2.0 and above)

Make use of the additional callback status information to decide what to do with the content.

Example 4.1: The example below displays all statuses, without inspection.

Server Response: {{uploadResponse1}}

Example 4.2: The example below displays only the server response, ignoring other contents

Server Response: {{uploadResponse2}}

Example 5 - Processing a full form (requirement: v0.2.0)

Post a full form with a file and other inputs (text, etc) to the server and get a JSON result.

Server Response: {{response | json}}
Fullname: {{response.fullname}}
Gender: {{response.gender}}
Favourite Color: {{response.color}}
Picture: {{response.pictureUrl}}