lundi 30 mai 2016

Pushing new date to ember javascript array

I am creating a basic ember app with javascript object arrays(Don't want to use anything else until I get a firm grasp). I am having trouble implementing functionality to add new users. I'm not sure what to add to my controller.

In the template:

<form > 

<button class="btn btn-default" type="submit">Add</button>
</form>

My students route: import Ember from 'ember';

 var students = [{
  id: 1,
  name: 'John',

}, {
  id: 2,
  name: 'Vanessa'     
}];

export default Ember.Route.extend({
  model() {
    return students;
  }
});




Aucun commentaire:

Enregistrer un commentaire