import {inject} from 'aurelia-dependency-injection'; import { ValidationControllerFactory, ValidationController, ValidationRules } from 'aurelia-validation'; import {BootstrapFormRenderer} from './bootstrap-form-renderer'; @inject(ValidationControllerFactory) export class RegistrationForm { firstName; lastName; thing; text1; controller; constructor(controllerFactory) { this.controller = controllerFactory.createForCurrentScope(); this.controller.addRenderer(new BootstrapFormRenderer()); this.thing = {}; } bind() { ValidationRules .ensure(a => a.firstName).satisfies(value => { console.log('firsty'); return true; }).required() .on(this); } submit() { this.controller.validate(); this.text1Component.validate(); this.thingComponent.validate(); this.thing1Component.validate(); console.log(this.thing1Component); } }