Skip to content

Instantly share code, notes, and snippets.

@kenelliott
Created May 28, 2014 17:11
Show Gist options
  • Save kenelliott/49a22555b6c82288c8d2 to your computer and use it in GitHub Desktop.
Save kenelliott/49a22555b6c82288c8d2 to your computer and use it in GitHub Desktop.
App.LocationEditController = Em.ObjectController.extend({
productList: [],
unassignedProducts: (function() {
var res;
res = this.store.find('product').then((function(_this) {
return function(products) {
return _this.store.find('locationProduct', {
by_location_id: 1
}).then(function(locationProducts) {
var productIds;
productIds = locationProducts.getEach('product.id');
return products.filter(function(product) {
return !productIds.contains(product.id);
});
});
};
})(this));
console.log("result", res);
return res;
}).property()
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment