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