mirror of
https://github.com/Nezumi-2711/javascript-training.git
synced 2026-09-22 13:38:43 +00:00
25 lines
571 B
JavaScript
25 lines
571 B
JavaScript
export default class RegisterController {
|
|
constructor(service, view) {
|
|
this.registerView = view.registerView;
|
|
this.service = service;
|
|
}
|
|
|
|
handlerCheckUserExist(email) {
|
|
return this.service.userService.checkUserExist(email);
|
|
}
|
|
|
|
handlerSaveUser(user) {
|
|
return this.service.userService.saveUser(user);
|
|
}
|
|
|
|
init() {
|
|
if (this.registerView) {
|
|
this.registerView.addHandlerForm(
|
|
this.handlerCheckUserExist.bind(this),
|
|
this.handlerSaveUser.bind(this),
|
|
);
|
|
this.registerView.addHandlerInputFormChange();
|
|
}
|
|
}
|
|
}
|