import { CancelToken } from "web-atoms-core/dist/core/types"; import { AtomViewModel } from "web-atoms-core/dist/view-model/AtomViewModel"; import { IUser } from "./SignupService"; export default class SimpleViewModel extends AtomViewModel { model: IUser; countryList: any; stateList: any; /** * Validate decorator will begin watching changes in property and it will * return error if validation failed. First time, when the form is empty, * no error will be displayed. * * But as soon as you hit `this.isValid` or method is decorated with `@Action({ validate: true})` * the errors bound to UI element will display an error. And it will automatically remove when * the property is modified. */ readonly errorFirstName: string; readonly errorLastName: string; readonly errorEmailAddress: string; readonly errorPassword: string; readonly errorPasswordAgain: string; private signupService; /** * This method will be executed automatically when view model is initialized. */ loadCountries(): Promise; /** * This method will be executed when view model is initialized. This method will * also be executed when any property chain of `this` e.g. `this.model.country` is * modified. */ loadStates(ct: CancelToken): Promise; /** * Argument `validate` true will force validation error to be displayed and it will stop execution if * there are any validations that have failed. * * Argument `success` will display an alert with message if the execution was successful. * * By default this method will display an alert if there was any exception while trying to execute * this method. */ signup(): Promise; }