A flag that indicated if the form has been changed.
A map of fields used in this form.
A flag that indicates if the form is currently valid.
An interceptor for the submit event that prevents invalidforms from beeing submited.
A map containing keys of properties that will pull in their value froma given attribute of the defining element. The values are strings thatdescribe the binding that will be created as well as the attribute name.In case you want the attribute's value to be treated as an expression youcan use one of the following symbols as a first character:
If one of these characters is found they will be trimmed from the string.If the string is not empty after that it will be used as the name of attribute.Otherwise the attribute's name is assumed to be equal to a hyphenated versionof the property name.
export default class MyComponent extends Component { static attributes = { // <my-component use-as-is=""></my-component> useAsIs: '', // <my-component compile-once="myVar + 1"></my-component> compileOnce: '?', // <my-component bind-one-way="myVar + 10"></my-component> bindOneWay: '.', // <my-component my-attribute="myVar"></my-component> bindTwoWayAndDefineName: ':my-attribute' };}
This static property lets you define listeners that will be executed whenproperties of the component change.
It should be a map where the keys are paths that should be watched on the component andthe values are names of methods that will be invoked on the component instance.
In the following example you can see a component that reacts to changesin the size of the defining element.
export default class MyComponent extends Component { static inject: {element: Element}; static bindings = { 'element.clientHeight': 'heightChange' }; width: number; heightChange(height: number) { this.width = height * 2; }}
When a string is given it must contain the html of the component's template.
In general you should not make use of this at all. Your template should bein a separate file with the same name and in the same folder as your component'sTypeScript file. This feature is only for advanced usage (for example having an emptytemplate by setting this to an empty string) or rapid prototyping.
Updates the value of field.
The Form component provides simple validation forform field components.
{ default } from mahalo/components/form