UNPKG

zettapi_client

Version:

Client side CRUD operations in angular to use with zettapi_server rest api to get started quickly in any CMS project

28 lines (24 loc) 728 B
app.directive('zlActivation', function (zapiPath) { return { restrict: 'E', scope: true, replace: false, templateUrl: zapiPath + '/directives/activation/activation.html', controller: function ($scope, $auth, $location, $routeParams) { $scope.user = null; $auth.activateAccount($routeParams.code, function (err, user) { if (err) { return $location.path('/'); } $scope.user = user; }); $scope.changePassword = function (newPassword1, newPassword2) { $auth.changePassword($scope.user, newPassword1, newPassword2, function (err) { if (!err) { return $location.path('/'); } }); }; } }; });