Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infer field type from model attribute #13

Open
Emerson opened this issue Mar 26, 2015 · 0 comments
Open

Infer field type from model attribute #13

Emerson opened this issue Mar 26, 2015 · 0 comments

Comments

@Emerson
Copy link
Owner

Emerson commented Mar 26, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant