Szenario ist,AngularFire Browser Refresh gibt Fehler Seite nicht gefunden
Im neu zu AngularJS und sie ein AngularJS mit AngularFire, ich habe meine Routing-bye mit $routeProvider
definiert, siehe unten
var appMainModule = angular.module('appMain', [ 'firebase','ngRoute'])
.config(function ($routeProvider, $locationProvider) {
$routeProvider.when('/', { templateUrl: '/Templates/CustomerLogin.html', controller: 'HomeCtrl' });
$routeProvider.when('/customer/home', { templateUrl: '/Templates/CustomerHome.html' , controller:'ForLogout'});
$routeProvider.when('/customer/singup', { templateUrl: '/Templates/CustomerSinup.html', controller: 'RegisterCtrl' });
$routeProvider.when('/dashboard/godash', { templateUrl: '/Templates/dashboard.html', controller: 'DashboardCtrl' });
$routeProvider.when('/customer/list', { templateUrl: '/Templates/CustomerList.html', controller: 'customerListViewModel' });
$routeProvider.when('/customer/detail', { templateUrl: '/Templates/CustomerDetail.html', controller: 'customerDetailViewModel' });
$routeProvider.when('/customer/googlemap', { templateUrl: '/Templates/GoogleMap.html', controller: 'MapCtrl' });
// $routeProvider.when('/customer/postdata', { templateUrl: '/Templates/CustomerPostData.html', controller: 'AddPostCtrl' });
$routeProvider.when('/customer/getdata', { templateUrl: '/Templates/CustomerGetData.html', controller: 'GetCtrl', reloadOnSearch: false });
$routeProvider.when('/victim/getdata', { templateUrl: '/Templates/RiskVictimDetail.html', controller: 'VictimGetCtrl' });
$routeProvider.otherwise({ redirectTo: '/' });
$locationProvider.html5Mode(true);
});
das ist mein Login Controller
appMainModule.controller('HomeCtrl', ['$scope', '$location', 'CommonProp', '$firebaseAuth', function ($scope, $location,CommonProp, $firebaseAuth) {
var firebaseObj = new Firebase("FireaseURL/");
loginObj = $firebaseAuth(firebaseObj);
$scope.user = {};
var login = {};
$scope.SignIn = function (e) {
login.loading = true;
e.preventDefault();
var username = $scope.user.email;
var password = $scope.user.password;
loginObj.$authWithPassword({
email: username,
password: password
})
.then(function (user) {
//Success callback
// alert('Authentication successful');
login.loading = false;
$location.path('/dashboard/godash')
}, function (error) {
//Failure callback
alert('Authentication failure');
});
}
}])
mein Problem ist, dass, wenn ich meine Login-Seite durch Aktualisierung des Browsers zu aktualisieren, es erfolgreich aktualisiert, aber nach der Anmeldung, wenn aktualisiert beliebige Seite es Nicht gefunden
mein HTML gibt mir
Seite Fehler:
<!DOCTYPE html> <html data-ng-app="sampleApp"> <head> <title>My new Project</title> <meta charset="utf-8" /> <!-- AngularJS --> <script src="Scripts/angular.min.js"></script> <script src="Scripts/angular-route.min.js"></script> <!-- Firebase --> <script src="https://cdn.firebase.com/js/client/2.2.4/firebase.js"></script> <!-- AngularFire --> <script src="https://cdn.firebase.com/libs/angularfire/1.2.0/angularfire.min.js"></script> <script src="Scripts/App.js"></script> <base href="/" /> </head> <body ng-view> </body> </html>
'requireBase: false' Arbeits –
nicht Lesen Sie mehr über' requireBase: false' von https: //code.angularjs.org/1.3.14/docs/guide/$location, ich hatte mehr Details in der Antwort aktualisiert. – sreeramu
http: //webdesign.tutsplus.com/articles/quick-tip-set-relative-URLs-mit-der-Basis-Tag - cms-21399 von diesem Beitrag, ich denke, ich brauche URL umschreibt, Basis-Tag wird keine Lösung –