ember.js - ember store.find promise not being fulfilled in time -
i'm using arraycontroller itemcontroller i'm having problems getting store.find promise fulfilled before hotelname , hoteladdress properties in itemcontroller used. idea on how can unsure store find fulfilled before returning? know store.find works. i'm able see results timing off. thank you.
export default ember.arraycontroller.extend({ itemcontroller: ..., }); export default ember.objectcontroller.extend({ init: function() { this._super(); }, hotelname: function() { var self = this; self.store.find('hotel', this.get('hotelid')).then(function(hotel) { self.set('hotelname', hotel.get('name')); }); }.property('hotelid'), hoteladdress: function() { var self = this; self.store.find('hotel', this.get('hotelid')).then(function(hotel) { self.set('hoteladdress', hotel.get('street')); }); }.property('hotelid') });
Comments
Post a Comment