Skip to content

Instantly share code, notes, and snippets.

@kamaulynder
Created April 18, 2017 16:12
Show Gist options
  • Save kamaulynder/fbdb8b0a22cb3869801dfc1524eaeaa8 to your computer and use it in GitHub Desktop.
Save kamaulynder/fbdb8b0a22cb3869801dfc1524eaeaa8 to your computer and use it in GitHub Desktop.
class menuController {
constructor(Upload, $state, contactsImportEndpoint) {
"ngInject";
this.name = 'menu';
this.Upload = Upload;
this.contactsImportEndpoint = contactsImportEndpoint;
}
$onInit() {
}
fileUpload($file){
this.upload = Upload.upload({
url: this.contactsImportEndpoint,
data: {file: $file},
}). then (function (response) {
this.result = response.data;
console.log(this.result);
});
}
}
export default menuController;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment