jeudi 24 novembre 2016

Append JSON elements in Ember

I am having an array with some of values (i.e., [1,2,3,4,5]), now i have to convert this array elements into JSON format.

I tries this one,

var Jsondata = {};
            for (i = 0; i < Response.get('firstname').length; i++) {
                Jsondata.push({
                    name : Response.get('firstname')[i]
                });
            }
 Ember.Logger.debug(Jsondata );

but it shows some error :

carousel.js:575 Uncaught TypeError: Jsondata.push is not a function(…)

how to append json elements in ember?




Aucun commentaire:

Enregistrer un commentaire