I am working on it now; it takes more work to make it beautiful and much more, but I hope you get a general idea.
The confirmation URL is as follows:
http://localhost:8000/app.html
(localhost: 8000, ). ui-router:
var confirm = {
name: 'confirm',
url: '/confirm/:auth',
templateUrl: 'app/front/partial/confirm.html',
params: {auth: {}}
} ;
$stateProvider.state(confirm) ;
partial.html partial (, , !):
<div ng-controller="Fapi.Front.Confirm.Ctrl">
CONFIRM
</div>
:
angular.module('myApp')
.controller('App.Front.Confirm.Ctrl', [
'$scope', '$state', '$stateParams', 'toaster', 'MyDataService',
function ($scope, $state, $stateParams, toaster, MyDataService) {
MyDataService.confirm (
{auth: $stateParams.auth},
function (data) {
toaster.pop('success', 'Your registration has been confirmed') ;
setTimeout(function () { $state.go('login') }, 5000) ;
},
function (data) {
toaster.pop('error', data.message) ;
}
)
}]) ;
MyDataService - , $http- .
, "" , URL- script , , " " ( ), , AJAX .