Tuesday 15 July 2014

ember.js - Ember JS, updating array not reflecting in views -


Updating the Amber JS array is not showing in ideas.

Administrator

  App.MyController = Ember.ArrayController.extend ({Result: [], init: function () {_this = this app.myModel.find ({ }). Then (function (content) {obj1 = contents.objectAt (0) obj1.get ('data') .menan.resources.for unit (function (item) {_this.results.push (item)}}} }} // the rest of the code}}}   

Template

  {{# every result}} // Show the items of the show. {{/ }}   

This is a piece of code in which I am fetching data from the server, and when it loads, I am pushing it into the result array. This load takes some time from time to data, so template map on empty result array. Ideally, the result array should update things in the template, but it should not be logical.

Does any body know where I am missing or doing wrong?

Thank you in advance.

You have to work for binding, instead of push pushObject To sum up.

  App.MyController = Ember.ArrayController.extend ({Result: [], init: function () {_this = this; App.MyModel.find ({}). Then (function ( Content} {obj1 = contents.objectAt (0); obj1.get ('data') HMINET property.ForEach (function (item) {_this.results.pushObject (item)})}}) // code rest code }});   

More information about amber array> push object please see

Hope this will be helpful.

No comments:

Post a Comment