37 lines
876 B
JavaScript
37 lines
876 B
JavaScript
import ngModule from '../../module';
|
|
|
|
export default class Controller {
|
|
constructor($scope, $element, $http, vnApp, $translate, $state) {
|
|
Object.assign(this, {
|
|
$scope,
|
|
$element,
|
|
$http,
|
|
vnApp,
|
|
$translate,
|
|
$state
|
|
});
|
|
}
|
|
|
|
goToLogin() {
|
|
this.vnApp.showSuccess(this.$translate.instant('Notification sent!'));
|
|
this.$state.go('login');
|
|
}
|
|
|
|
submit() {
|
|
const params = {
|
|
user: this.user
|
|
};
|
|
|
|
this.$http.post('VnUsers/recoverPassword', params)
|
|
.then(() => {
|
|
this.goToLogin();
|
|
});
|
|
}
|
|
}
|
|
Controller.$inject = ['$scope', '$element', '$http', 'vnApp', '$translate', '$state'];
|
|
|
|
ngModule.vnComponent('vnRecoverPassword', {
|
|
template: require('./index.html'),
|
|
controller: Controller
|
|
});
|