@ -1,5 +1,8 @@ |
|||||
# carsincommonApp |
# carsincommonApp |
||||
|
|
||||
server code: https://github.com/arnaucode/carsincommonServer |
|
||||
|
- server code: https://github.com/arnaucode/carsincommonServer |
||||
|
- frontend app code: https://github.com/arnaucode/carsincommonApp |
||||
|
- images server: https://github.com/arnaucode/goImgServer |
||||
|
- admin web: https://github.com/arnaucode/carsincommonAdminWeb |
||||
|
|
||||
![carsincommon](https://raw.githubusercontent.com/arnaucode/carsincommonApp/master/carsincommon.png "carsincommon") |
![carsincommon](https://raw.githubusercontent.com/arnaucode/carsincommonApp/master/carsincommon.png "carsincommon") |
@ -0,0 +1,33 @@ |
|||||
|
angular.module('app.password', ['pascalprecht.translate']) |
||||
|
|
||||
|
.controller('PasswordCtrl', function($scope, $stateParams, $translate, |
||||
|
$http, $ionicLoading) { |
||||
|
$scope.newPass = {}; |
||||
|
$scope.changePassword = function() { |
||||
|
console.log($scope.newPass); |
||||
|
$http({ |
||||
|
url: urlapi + 'changePassword', |
||||
|
method: "PUT", |
||||
|
data: $scope.newPass |
||||
|
}) |
||||
|
.then(function(data) { |
||||
|
console.log(data); |
||||
|
$ionicLoading.show({ |
||||
|
template: 'Password updated', |
||||
|
noBackdrop: true, |
||||
|
duration: 2000 |
||||
|
}); |
||||
|
window.location = "#app/settings"; |
||||
|
}, |
||||
|
function(data) { // optional
|
||||
|
// failed
|
||||
|
console.log(data); |
||||
|
$ionicLoading.show({ |
||||
|
template: 'Error updating password', |
||||
|
noBackdrop: true, |
||||
|
duration: 2000 |
||||
|
}); |
||||
|
|
||||
|
}); |
||||
|
}; |
||||
|
}); |
@ -0,0 +1,21 @@ |
|||||
|
<ion-view view-title="{{'Change_password' | translate}}"> |
||||
|
<ion-content> |
||||
|
<div class="list"> |
||||
|
<label class="item item-input"> |
||||
|
<span class="input-label">{{'Old_Password' | translate}}</span> |
||||
|
<input ng-model="newPassword.old" type="password" placeholder="{{'Old_Password' | translate}}" style="-webkit-text-security: disc;"> |
||||
|
</label> |
||||
|
<label class="item item-input"> |
||||
|
<span class="input-label">{{'New_Password' | translate}}</span> |
||||
|
<input ng-model="newPassword.new1" type="password" placeholder="{{'New_Password' | translate}}" style="-webkit-text-security: disc;"> |
||||
|
</label> |
||||
|
<label class="item item-input"> |
||||
|
<span class="input-label">{{'New_Password' | translate}}</span> |
||||
|
<input ng-model="newPassword.new2" type="password" placeholder="{{'Repeat_New_Password' | translate}}" style="-webkit-text-security: disc;"> |
||||
|
</label> |
||||
|
</div> |
||||
|
<div ng-click="changePassword()" class="button button-block c_deepPurple200"> |
||||
|
{{'Change_password' | translate}} |
||||
|
</div> |
||||
|
</ion-content> |
||||
|
</ion-view> |