Is it possible to create an "app-form" custom element that contains the validation controller instance and handles the validation so parent components can use it without knowing about validation?
I'm considering something like:
parent.vm.html
<app-form validate.bind="true">
<app-form-group>
<app-label slot="label">First Name</app-label>
<app-input slot="input" type="text" value.bind="model.firstName"></app-input>
</app-form-group>
</app-form>
input.element.html
<template>
<input
value.bind="value & validateOnBlur"
/>
</template>
sample.model.ts
export class SampleModel {
firstName: string;
}
ValidationRules.ensure((m: SampleModel) => m.firstName)
.required()
.on(SampleModel);