{"action":"created","issue":{"url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/323","labels_url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/323/labels{/name}","comments_url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/323/comments","events_url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/323/events","html_url":"https://github.com/johnpapa/angular-styleguide/issues/323","id":60743112,"number":323,"title":"Resource and Service","user":{"login":"matheussampaio","id":1020467,"avatar_url":"https://avatars.githubusercontent.com/u/1020467?v=3","gravatar_id":"","url":"https://api.github.com/users/matheussampaio","html_url":"https://github.com/matheussampaio","followers_url":"https://api.github.com/users/matheussampaio/followers","following_url":"https://api.github.com/users/matheussampaio/following{/other_user}","gists_url":"https://api.github.com/users/matheussampaio/gists{/gist_id}","starred_url":"https://api.github.com/users/matheussampaio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheussampaio/subscriptions","organizations_url":"https://api.github.com/users/matheussampaio/orgs","repos_url":"https://api.github.com/users/matheussampaio/repos","events_url":"https://api.github.com/users/matheussampaio/events{/privacy}","received_events_url":"https://api.github.com/users/matheussampaio/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-11T22:47:35Z","updated_at":"2015-03-12T01:24:39Z","closed_at":"2015-03-12T01:24:39Z","body":"Hello , I am trying to refactor my project , but I have doubts on how to refactor these two services below. Currently they are in the same file.\r\n\r\n```javascript\r\nvar wfApp = angular.module('wfApp.services', ['ngResource']);\r\n\r\nwfApp.factory(\"Fish\", ($resource) => {\r\n    return $resource('/api/fish/:id');\r\n});\r\n\r\nwfApp.factory('FishService', (Fish) => {\r\n    var fishService = {};\r\n\r\n    fishService.requestFish = (fishid) => {\r\n        Fish.get({'id':  fishid}, (fish) => {\r\n            fishService.fish = fish;\r\n        });\r\n\r\n        return fishService;\r\n    };\r\n\r\n    fishService.searchFish = (query) => {\r\n        Fish.query(query, (fishs) => {\r\n            fishService.fishs = fishs;\r\n        });\r\n\r\n        return fishService;\r\n    };\r\n\r\n    return fishService;\r\n});\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/comments/78407633","html_url":"https://github.com/johnpapa/angular-styleguide/issues/323#issuecomment-78407633","issue_url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/323","id":78407633,"user":{"login":"johnpapa","id":1202528,"avatar_url":"https://avatars.githubusercontent.com/u/1202528?v=3","gravatar_id":"","url":"https://api.github.com/users/johnpapa","html_url":"https://github.com/johnpapa","followers_url":"https://api.github.com/users/johnpapa/followers","following_url":"https://api.github.com/users/johnpapa/following{/other_user}","gists_url":"https://api.github.com/users/johnpapa/gists{/gist_id}","starred_url":"https://api.github.com/users/johnpapa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnpapa/subscriptions","organizations_url":"https://api.github.com/users/johnpapa/orgs","repos_url":"https://api.github.com/users/johnpapa/repos","events_url":"https://api.github.com/users/johnpapa/events{/privacy}","received_events_url":"https://api.github.com/users/johnpapa/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T01:24:39Z","updated_at":"2015-03-12T01:24:39Z","body":"Good question fro StackOverflow"}}