本文整理汇总了TypeScript中aurelia-validation.ValidationController类的典型用法代码示例。如果您正苦于以下问题:TypeScript ValidationController类的具体用法?TypeScript ValidationController怎么用?TypeScript ValidationController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ValidationController类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(private router: Router, private storage: Storage, private validator: Validator, controllerFactory: ValidationControllerFactory) {
this.controller = controllerFactory.createForCurrentScope(validator);
this.controller.validateTrigger = validateTrigger.changeOrBlur;
this.controller.subscribe(event => this.validateWhole());
}
示例2: saveProfile
saveProfile()
{
this.controller.reset()
if ( String(this.user.newPass) === String(this.user.repeatPass) && String(this.user.newPass) )
{
this.connect.createProfile( this.user )
.then(
(data: any) =>
{
if ( data.response === 'done' )
{
this.updateData();
this.aurelia.setRoot('app');
}
else
{
console.log( data )
}
}
);
}
else
{
this.controller.addError('New password doen\'t match.', 'password')
console.log( 'new password doen\'t match' )
}
}
示例3: save
async save() {
if (this.validation.validate().length > 0) {
alert('There are validation errors');
return;
}
await this.state._save();
alert('Changes saved');
}
示例4: save
save() {
this.validation.validate()
.then(result => {
if (result.valid) {
this.apiClient.updatePump(this.pump);
//this.notify.info('Sump Pump Details Saved');
} else {
}
})
}
示例5: submit
submit() {
if (this.validation.validate().length > 0) {
alert('There are validation errors');
return;
}
this.state.gitAuthorization = btoa(`${this.username}:${this.password}`);
this.state._save();
this.dialog.ok();
}
示例6: validateOnRender
validateOnRender() {
if (this.options.validateOnRender) {
this.logger.info('schemaform-attached:validate');
this.validationController.validate();
}
}