I am playing with emberFire / Ember Data but can't find why this code will not working ??? The var id_cust_ fb_cust is always undefined ? When i look in ember inspector the query's works fine ! What am i doing wrong ???
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
fixit: function() {
var teller = 11;
var _this = this;
var strTeller = teller.toString();
_this.store.findRecord('address',strTeller).then(function(address){
var id_cust_presta_addr = address.get('id_customer');
console.log('Id Customer Presta in address is :' + id_cust_presta_addr);
_this.store.query('customer', {
orderBy: 'id_customer',
equalTo: id_cust_presta_addr
}).then(function(customer){
var id_cust_fb_cust = customer.get('email');
console.log('Id Customer Presta in CUSTOMER is :' + id_cust_fb_cust + 'voor : ' + id_cust_presta_addr );
})
});
} //fixit
} // actions
}); // export
Aucun commentaire:
Enregistrer un commentaire