aurelia-form
Version:
Makes working with forms just a tad more pleasant.
49 lines (36 loc) • 905 B
Markdown
# Element sorting
It's possible to change the order in which form elements get rendered by [`<entity-form />`](../component/entity-form.md). The way you'd go about doing this is by using the [` ` decorator](../decorators.md#position).
There's very little to explain on the subject, so here's an example that shows you how to use it.
## Example
**entity/person.js**
```js
import {position, inputType} from 'aurelia-form';
export class Person {
lastName;
firstName;
middleName;
age;
email;
}
```
**page/person.js**
```js
export class SomeViewmodel {
constructor() {
this.person = new Person;
}
}
```
**page/person.html**
```html
<!-- Yes, this renders the entire form. Awesome right!? -->
<entity-form entity.bind="person">
</entity-form>
```