mardi 27 février 2018

How can I push JSONobject into Ember Array?

I tried it as below but it didn't work. Shows error in pushObject line. What is the correct way to make it work ?

   infantJsonArr: Ember.A(),
....//jsonObject is
var jsonObject = '{ "traveller_name":"Traveller Name"}'
............//later adding in infantJsonArr  
this.get('infantJsonArr').pushObject(JSON.parse(jsonObject));

`




Aucun commentaire:

Enregistrer un commentaire