jeudi 7 mai 2015

Access and Update a Fixture Ember JS

How can I update/edit a specific Person in IndexController?

App.Person=DS.Model.extend({
        name:DS.attr('string'),
        iminus:DS.attr(),
        iplus:DS.attr()
    });

    App.Person.FIXTURES=[
        {
            id:1,
            name:'M',
            iminus:[{amount:50,pers:'A'}],
            iplus:[]
        },
        {
            id:2,
            name:'An',
            iminus:[{amount:20,pers:'Mo'}],
            iplus:[]
        }
    ];
    App.IndexRoute=Ember.Route.extend({
        model:function(){
            return this.store.findAll('person');
        }
    });
    App.IndexController=Ember.ArrayController.extend({
    actions:{
        createNew:function(){
            //Access and Update a person record based on name
        }
    }
    });

How can I access and update the person record based on a name inside IndexController




Aucun commentaire:

Enregistrer un commentaire