Reputation: 23
I am trying to force download a file from a url. The App is build in angular + Ionic. I am using the plugin "Cordova file transfer".
Followed the steps shared in the url: http://ngcordova.com/docs/plugins/fileTransfer/
But when i click on the download it gives me an error: ReferenceError: FileTransfer is not defined
Code for package.json file
<code>
{
"name": "continuitas",
"version": "1.1.1",
"description": "continuitas: An Ionic project",
"devDependencies": {
"gulp": "^3.5.6",
"gulp-clean-css": "^3.7.0",
"gulp-rename": "^1.2.0",
"gulp-sass": "^3.1.0"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"ionic-plugin-keyboard",
"cordova-plugin-splashscreen"
],
"cordovaPlatforms": []
}
code:
My Need here is to Download a file from a url in the ionic application.
Thanks in Advance.
Upvotes: 1
Views: 594
Reputation: 96
There might be some missing injection in ng-crodova.js file itself so try to inject 'ngCordova.plugins.fileTransfer' in your app module
angular.module('app.starter', ['ngCordova', 'ngCordova.plugins.fileTransfer'])
Upvotes: 0