|
在实现下载功能的时候提示错误:index.html引入文件:
<script type="text/javascript" src="lib/ngcordova/dist/ng-cordova.min.js"></script>
以及module中注入:
var app = angular.module("myApp", ["ionic","ngCordova"])
.controller(["$scope","$cordovaFileTransfer","$timeout",function($scope,$cordovaFileTransfer,$timeout){
$scope.dow = function(){
var url = "url";
var targetPath = "/" + fileName;
var trustHosts = true
var options = {};
$cordovaFileTransfer.download(url, targetPath, options, trustHosts)
.then(function(result) {
// Success
console.log("成功下载")
}, function(err) {
console.log("下载失败");
// Error
}
};
}]
在加载的时候提示FileTransfer is not defined,请问有谁知道是什么问题呢,是少引了什么文件吗?还是写错什么了?求助!!
|
|