Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function (BlockResource) {
- var collection;
- this.init = function () {
- collection = BlockResource.get().$promise;
- };
- this.getBlock = function (id) {
- if (!collection) {
- this.init();
- }
- return collection.then(function (blocks) {
- return blocks.filter(function (block) {
- return block.id = id;
- });
- });
- };
- this.getBlocks = function () {
- if (!collection) {
- this.init();
- }
- return collection;
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement