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

27 lines (24 loc) 829 B
app.directive('zlActivation', function (zapiPath) { return { restrict: 'E', scope: { zlClass: '@?' }, replace: false, templateUrl: zapiPath + '/directives/activation/activation.html', controller: function ($scope, $auth, $location, $routeParams) { $scope.user = null; if (typeof $scope.zlClass === 'undefined') $scope.zlClass = "form-control input-lg"; $auth.activateAccount($routeParams.code, function (err, user) { if (err) return swal("Atenção", err, "warning"); $scope.user = user; }); $scope.changePassword = function (item) { $auth.changePassword($scope.user, item.password, item.repeat, function (err) { if (err) return swal("Atenção", err, "warning"); $location.path('/'); }); }; } }; });