{"action":"closed","issue":{"url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/465","labels_url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/465/labels{/name}","comments_url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/465/comments","events_url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/465/events","html_url":"https://github.com/johnpapa/angular-styleguide/issues/465","id":98738137,"number":465,"title":"Calling functions inside functions in service/factory","user":{"login":"tobbbe","id":2511610,"avatar_url":"https://avatars.githubusercontent.com/u/2511610?v=3","gravatar_id":"","url":"https://api.github.com/users/tobbbe","html_url":"https://github.com/tobbbe","followers_url":"https://api.github.com/users/tobbbe/followers","following_url":"https://api.github.com/users/tobbbe/following{/other_user}","gists_url":"https://api.github.com/users/tobbbe/gists{/gist_id}","starred_url":"https://api.github.com/users/tobbbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobbbe/subscriptions","organizations_url":"https://api.github.com/users/tobbbe/orgs","repos_url":"https://api.github.com/users/tobbbe/repos","events_url":"https://api.github.com/users/tobbbe/events{/privacy}","received_events_url":"https://api.github.com/users/tobbbe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-03T13:01:50Z","updated_at":"2015-08-03T18:28:44Z","closed_at":"2015-08-03T18:28:44Z","body":"How do recommend calling a service function inside another function?\r\n    \r\n    function dataservice() {\r\n        var b = 42;\r\n        \r\n        var service = {\r\n            getSomething: getSomething,\r\n            getSomethingElse: getSomethingElse\r\n        };\r\n    \r\n        return service;\r\n    \r\n        ////////////\r\n    \r\n        function getSomething() {\r\n            // this might cause problems right?\r\n            return calcSomething(value);\r\n        }\r\n        \r\n        function getSomethingElse() {\r\n            // this might cause problems right?\r\n            return calcSomething(value);\r\n        }    \r\n        \r\n        function calcSomething(a) {\r\n            return a + b;\r\n        }\r\n    }"}}