mercredi 6 juillet 2016

Ember Dynamic Input Value from Model - HTMLbars

Assuming the following model:

export default Ember.Route.extend({
  model() {
    return ['car', 'truck', 'boat'];
  }
});

I can loop through the model like so:


     - #


which would result in this:

car - #0
truck - #1
boat - #2

However, what if I wanted dynamic properties in an input (I know the following does not work the way I want):


    


Which results in all of the input fields loading with the value already defined: car, truck, and boat in the input.

What I want to make happen is this (assuming you looped through the model, it would 'output' this):





but it's not outputting that, it outputs this:





The values are already defined but I would like to define 'car' in the model (meaning it has no value) I'm only setting up the name of the input and then later, I would be able to access so that whatever the user types in the blank input, it outputs to

Aucun commentaire:

Enregistrer un commentaire