lundi 1 août 2016

How do I work with handlebars (EmberJS)

So when I click a button on my template it is supposed to change a value and display a list of records on the screen. This is not happening. What am I doing wrong? Below is the code for my controller, model, template and route.

Controller:

import Ember from 'ember';

export default Ember.Controller.extend({

    usernameIn: '',
    passwordIn: '',
    found: '', 
    display: false,

    actions:{

        renderNotes(){
            this.display = true;
        }
    }

});

Route:

import Ember from 'ember';

export default Ember.Route.extend({

model()
{
    return this.store.findAll('note');
}

});

Template:

<h1>Login:</h1>

<h3>Username:</h3>
<h3>Password:</h3>
<br>
<br>
<button>Submit</button>


    <thead>
      <tr>
          <th>Username</th>
          <th>Note</th>
      </tr>
    </thead>
    <tbody>
    

        <tr>
            <th></th>
            <td></td>
        </tr>

    
    </tbody>




Model:

import DS from 'ember-data';

export default DS.Model.extend({

    note: DS.attr('string'),
    username: DS.attr('string'),
    password: DS.attr('string')
});




Aucun commentaire:

Enregistrer un commentaire