mercredi 20 juillet 2016

Array variable in an ember controller

-I'm kind of new to ember js and javascript in general and I can't seem to figure out why my methods keep spitting out the error that both taskData and personData are undefined. Any feedback is appreciated!

import Ember from 'ember';

export default Ember.Controller.extend({

    taskData: [],
    personData: [],



      actions: {

          taskData: [],
          personData: [],

        saveTask() {

            var task = this.get("task");
            taskData.push(task);
        },

        savePerson()
        {
            var person = this.get("person");
            personData.push(person);
        },

        print(){

            alert(taskData);
            alert(personData);
        }

      }

});




Aucun commentaire:

Enregistrer un commentaire