[英]AngularJS Forgot password
如果您可以更改電子郵件中的鏈接,請按以下方式更改它:
http://localhost:3000/#/resetpassword/<token>
現在,在您的角度路線中,您需要按以下方式收聽此路線:
angular.module('myApp', ['ngRoute'])
.controller('ResetPasswordController', function($scope, $route, $routeParams, $location) {
//password resetting functionality
})
.config(function($routeProvider, $locationProvider) {
$routeProvider
.when('/resetpassword/:token', {
templateUrl: 'reset.html',
controller: 'ResetPasswordController',
resolve: {
// Call the backend service to check if the token is valid
verifyToken: function($q, $route) {
var deferred = $q.defer();
$http({
method: 'GET',
url: '/reset/' + $route.current.params.token
}).success(function (data) {
deferred.resolve(data);
}).error(function (msg) {
deferred.reject(msg);
});
return deferred.promise;
}
}
})
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.