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

20 lines (19 loc) 721 B
app.directive('zlChangePassword', function(zapiPath) { return { restrict: 'E', scope: { zlClass: '@?' }, replace: false, templateUrl: zapiPath + '/directives/changePassword/changePassword.html', controller: function($scope, $auth, $rootScope) { if (typeof $scope.zlClass === 'undefined') $scope.zlClass = "form-control input-lg"; $scope.changePassword = function(item) { $auth.changePassword($rootScope.login, item.password, item.repeat, function(err) { if (err) return swal("Atenção", err, "warning"); $auth.logout(); }); }; } }; });