我在尝试使用我的应用程序中的firebaseAuth检查Auth状态时遇到问题
这是我的示例代码
(function(){
'use strict';
angular.module('inicio')
.config(['$routeProvider', '$locationProvider','Auth', InicioRoutes]);
function InicioRoutes($routeProvider, $locationProvider, $q){
$routeProvider
.when('/inicio', {
templateUrl: 'src/pages/inicio/view/content.html',
controller: 'InicioController',
controllerAs: 'page',
resolve: {
// controller will not be loaded until $waitForAuth resolves
// Auth refers to our $firebaseAuth wrapper in the example above
'currentAuth': ['Auth', function(Auth) {
// $waitForAuth returns a promise so the resolve waits for it to complete
return Auth.$waitForAuth();
}]
}
});
}
})();
这是我的一个模块的路径控制器
angular.js:68 Uncaught Error: [$injector:modulerr] Failed to instantiate module starterApp due to:
Error: [$injector:modulerr] Failed to instantiate module inicio due to:
Error: [$injector:unpr] Unknown provider: Auth
http://errors.angularjs.org/1.5.5/$injector/unpr?p0=Auth
at http://127.0.0.1:8080/bower_components/angular/angular.js:68:12
at http://127.0.0.1:8080/bower_components/angular/angular.js:4458:19
at getService (http://127.0.0.1:8080/bower_components/angular/angular.js:4611:39)
at injectionArgs (http://127.0.0.1:8080/bower_components/angular/angular.js:4635:58)
at Object.invoke (http://127.0.0.1:8080/bower_components/angular/angular.js:4657:18)
at runInvokeQueue (http://127.0.0.1:8080/bower_components/angular/angular.js:4558:35)
at http://127.0.0.1:8080/bower_components/angular/angular.js:4567:11
at forEach (http://127.0.0.1:8080/bower_components/angular/angular.js:322:20)
at loadModules (http://127.0.0.1:8080/bower_components/angular/angular.js:4548:5)
at http://127.0.0.1:8080/bower_components/angular/angular.js:4565:40
http://errors.angularjs.org/1.5.5/$injector/modulerr?p0=inicio&p1=Error%3A%… F%2F127.0.0.1%3A8080%2Fbower_components%2Fangular%2Fangular.js%3A4565%3A40
at http://127.0.0.1:8080/bower_components/angular/angular.js:68:12
at http://127.0.0.1:8080/bower_components/angular/angular.js:4587:15
at forEach (http://127.0.0.1:8080/bower_components/angular/angular.js:322:20)
at loadModules (http://127.0.0.1:8080/bower_components/angular/angular.js:4548:5)
at http://127.0.0.1:8080/bower_components/angular/angular.js:4565:40
at forEach (http://127.0.0.1:8080/bower_components/angular/angular.js:322:20)
at loadModules (http://127.0.0.1:8080/bower_components/angular/angular.js:4548:5)
at createInjector (http://127.0.0.1:8080/bower_components/angular/angular.js:4470:19)
at doBootstrap (http://127.0.0.1:8080/bower_components/angular/angular.js:1746:20)
at bootstrap (http://127.0.0.1:8080/bower_components/angular/angular.js:1767:12)
http://errors.angularjs.org/1.5.5/$injector/modulerr?p0=starterApp&p1=Error…F%2F127.0.0.1%3A8080%2Fbower_components%2Fangular%2Fangular.js%3A1767%3A12)
我正在关注firebase文档的教程,但不知何故我无法使用tath工作,因为在文字新的角度。
修改
忘记堆栈跟踪
// DownloadFile AsyncTask
public class DownloadFile extends AsyncTask<String, Void, String> {
@Override
public void onPreExecute() {
super.onPreExecute();
Toast.makeText(getApplicationContext(), "Downloading...", Toast.LENGTH_LONG).show();
}
@Override
public String doInBackground(String... Url) {
try {
URL url = new URL(VIDURL);
URLConnection connection = url.openConnection();
connection.connect();
// Detect the file lenghth
int fileLength = connection.getContentLength();
/* ......Download Manager...... */
Uri uri = Uri.parse(VIDURL);
// Download Manager Request
DownloadManager.Request request = new DownloadManager.Request(uri);
request.setDestinationInExternalPublicDir(Utilities.LocalStoragePath(getApplicationContext()), extractLastWord(VIDURL));
long ID = downloadManager.enqueue(request);
db_obj.DetailsInsertion(extractLastWord(VIDURL), ID + "");
callNewThread();
/* ......Download Manager...... */
} catch (Exception e) {
// Error Log
Log.e("Error", e.getMessage());
e.printStackTrace();
}
return null;
}