Skip to content

Infer field type from model attribute #13

@Emerson

Description

@Emerson

But that brings me to another problem #8, and problems with the API in general. I would prefer a more "magic" API, wherein no type is required, and can be derived by the modelType or the DS.attr() call in the model. Perhaps this is already the case (have not had the chance to verify). If this is the case, then I would like something like this:

{{fm-field value=firstName}}

Currently, my needs are such that I would expect to be able to customize the output to be something like this:

<section class="form-field">
    <div class="form-label">
        <label for="first-name" class="form-field-label">First Name</label>
    </div>
    <div class="form-controls>
        <input type="text" id="first-name" placeholder="First Name" autofocus required />
    </div>
</section>

Notice how autofocus and required are specified based on the model declaration. I would expect to be do something along the lines of ember validations, where the validation can be specified on each model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions