Created
May 28, 2014 17:11
-
-
Save kenelliott/49a22555b6c82288c8d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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