In meinem Code location.path ("# /") funktioniert nicht Ich hatte viel versucht, aber ich verstehe nicht, warum es nicht funktioniert. Es gibt eine einfache Logik, dass nach der erfolgreichen Anmeldung Popup-Fenster geschlossen ist und das Benachrichtigungsleisten-Plugin benachrichtigt wird.location.path ("# /") funktioniert nicht
Ich schlug in diesem seit 4 Stunden.
Signup
(function() {
'use strict'
/*
* Signup Controller
* @param {$scope} Object
* @return
*/
function SignupCtrl($scope, $location, $window, $timeout, UserService, notifications) {
//$scope.captchaError=false;
//$scope.passwordPattern = '((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{8,})';
$scope.doRegistration = function() {
console.log("form validation status:" + $scope.frmSignup.$valid);
if (true === $scope.frmSignup.$valid) {
console.log("validation successfully executed");
UserService
.register($scope.user)
.error(function() {
angular.element('#btnCancelSignup').triggerHandler('click');
notifications.showError({
message: 'Ooops! there is error occured, please try again.',
hideDelay: 1500, //miliseconds
hide: true // boolean
});
$location.path("#/");
})
.then(function (res) {
if (res.data.status === 1) {
console.log("success in registration");
angular.element('#btnCancelSignup').trigger('click');
notifications.showSuccess({
message: 'Please check your email to complete registration.',
hideDelay: 1500, //miliseconds
hide: true // boolean
});
$location.path("#/");
if(!$scope.$$phase) $scope.$apply();
}
Recaptcha.reload();
});
}
}
}
angular
.module('AppWhizbite')
.controller('SignupCtrl', ['$scope', '$location', '$window', '$timeout', 'UserService', 'notifications', SignupCtrl]);
}());
Versuchen Sie, Hash anstelle von Pfad zu bearbeiten. '$ location.hash ('/')' –
@LuisMasuelli: danke für deine Antwort. aber es funktioniert nicht. Es hängt in URL wie folgt an: http: // localhost: 1000/#/#% 2F –
Beachten Sie, dass ich '/' anstelle von '# /' verwendet habe. –