{"action":"created","comment":{"url":"https://api.github.com/repos/mfmasuyama/spotifyApp/pulls/comments/87661168","pull_request_review_id":8268240,"id":87661168,"diff_hunk":"@@ -1,7 +1,54 @@\n-import {routes} from './routes';\n-import {ApiService} from './services';\n+import {routes} from \"./routes\";\n+import {ApiService} from \"./services\";\n \n+angular\n+.module(\"App\", [\"ngRoute\"])\n+.config(routes)\n+.service(\"ApiService\", ApiService)\n \n-angular.module('App', ['ngRoute'])\n-    .config(routes)\n-    .service('ApiService', ApiService);\n+\n+.controller('resultsCtrl', ['$scope', '$http', \"ApiService\", function($scope, $http, ApiService) {\n+    $scope.resultsCtrl = this;\n+\n+    this.getArtists = function() {\n+        ApiService.getArtists($scope.resultsCtrl.artist).then(function(artists) {\n+            this.artists = artists.items;\n+        }.bind(this));\n+    }\n+}])\n+.service('ApiService', ['$http', function($http) {\n+    this.getArtists = function(name) {\n+        return $http({\n+            method: 'GET',\n+            url: \"https://api.spotify.com/v1/search?q=\" + name + \"&type=artist&limit=10\"\n+        }).then(function(response) {\n+            return response.data.artists;\n+        }, function() {\n+            console.error('Error');\n+        })\n+    }\n+}])\n+.service('ApiService', ['$http', function($http) {\n+    this.getAlbums = function(name) {\n+        return $http({\n+            method: 'GET',\n+            url: \"https://api.spotify.com/v1/albums?ids=\" + name\n+        }).then(function(response) {\n+            return response.data;\n+        }, function() {\n+            console.error('Error');\n+        })\n+    }\n+}])\n+.service('ApiService', ['$http', function($http) {","path":"src/app/index.js","position":36,"original_position":48,"commit_id":"43c75c38f9e9d29c9fa71d69040db1f729a5412e","original_commit_id":"43c75c38f9e9d29c9fa71d69040db1f729a5412e","user":{"login":"nicolasepiscopo","id":4213840,"avatar_url":"https://avatars.githubusercontent.com/u/4213840?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolasepiscopo","html_url":"https://github.com/nicolasepiscopo","followers_url":"https://api.github.com/users/nicolasepiscopo/followers","following_url":"https://api.github.com/users/nicolasepiscopo/following{/other_user}","gists_url":"https://api.github.com/users/nicolasepiscopo/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolasepiscopo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolasepiscopo/subscriptions","organizations_url":"https://api.github.com/users/nicolasepiscopo/orgs","repos_url":"https://api.github.com/users/nicolasepiscopo/repos","events_url":"https://api.github.com/users/nicolasepiscopo/events{/privacy}","received_events_url":"https://api.github.com/users/nicolasepiscopo/received_events","type":"User","site_admin":false},"body":"be careful you are duplicating services, you should have only one with the same name, inside you can declare multiple methods to be used by other objects.","created_at":"2016-11-11T21:25:59Z","updated_at":"2016-11-11T21:25:59Z","html_url":"https://github.com/mfmasuyama/spotifyApp/pull/1#discussion_r87661168","pull_request_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/mfmasuyama/spotifyApp/pulls/comments/87661168"},"html":{"href":"https://github.com/mfmasuyama/spotifyApp/pull/1#discussion_r87661168"},"pull_request":{"href":"https://api.github.com/repos/mfmasuyama/spotifyApp/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/mfmasuyama/spotifyApp/pulls/1","id":92807583,"html_url":"https://github.com/mfmasuyama/spotifyApp/pull/1","diff_url":"https://github.com/mfmasuyama/spotifyApp/pull/1.diff","patch_url":"https://github.com/mfmasuyama/spotifyApp/pull/1.patch","issue_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/issues/1","number":1,"state":"open","locked":false,"title":"Spotify App","user":{"login":"mfmasuyama","id":23039045,"avatar_url":"https://avatars.githubusercontent.com/u/23039045?v=3","gravatar_id":"","url":"https://api.github.com/users/mfmasuyama","html_url":"https://github.com/mfmasuyama","followers_url":"https://api.github.com/users/mfmasuyama/followers","following_url":"https://api.github.com/users/mfmasuyama/following{/other_user}","gists_url":"https://api.github.com/users/mfmasuyama/gists{/gist_id}","starred_url":"https://api.github.com/users/mfmasuyama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfmasuyama/subscriptions","organizations_url":"https://api.github.com/users/mfmasuyama/orgs","repos_url":"https://api.github.com/users/mfmasuyama/repos","events_url":"https://api.github.com/users/mfmasuyama/events{/privacy}","received_events_url":"https://api.github.com/users/mfmasuyama/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-08T16:08:11Z","updated_at":"2016-11-11T21:27:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ebb79657ebfeb710a965d88754dd6b4c29d75d8d","assignee":{"login":"nicolasepiscopo","id":4213840,"avatar_url":"https://avatars.githubusercontent.com/u/4213840?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolasepiscopo","html_url":"https://github.com/nicolasepiscopo","followers_url":"https://api.github.com/users/nicolasepiscopo/followers","following_url":"https://api.github.com/users/nicolasepiscopo/following{/other_user}","gists_url":"https://api.github.com/users/nicolasepiscopo/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolasepiscopo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolasepiscopo/subscriptions","organizations_url":"https://api.github.com/users/nicolasepiscopo/orgs","repos_url":"https://api.github.com/users/nicolasepiscopo/repos","events_url":"https://api.github.com/users/nicolasepiscopo/events{/privacy}","received_events_url":"https://api.github.com/users/nicolasepiscopo/received_events","type":"User","site_admin":false},"assignees":[{"login":"nicolasepiscopo","id":4213840,"avatar_url":"https://avatars.githubusercontent.com/u/4213840?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolasepiscopo","html_url":"https://github.com/nicolasepiscopo","followers_url":"https://api.github.com/users/nicolasepiscopo/followers","following_url":"https://api.github.com/users/nicolasepiscopo/following{/other_user}","gists_url":"https://api.github.com/users/nicolasepiscopo/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolasepiscopo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolasepiscopo/subscriptions","organizations_url":"https://api.github.com/users/nicolasepiscopo/orgs","repos_url":"https://api.github.com/users/nicolasepiscopo/repos","events_url":"https://api.github.com/users/nicolasepiscopo/events{/privacy}","received_events_url":"https://api.github.com/users/nicolasepiscopo/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/pulls/1/commits","review_comments_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/pulls/1/comments","review_comment_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/issues/1/comments","statuses_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/statuses/43c75c38f9e9d29c9fa71d69040db1f729a5412e","head":{"label":"mfmasuyama:dev","ref":"dev","sha":"43c75c38f9e9d29c9fa71d69040db1f729a5412e","user":{"login":"mfmasuyama","id":23039045,"avatar_url":"https://avatars.githubusercontent.com/u/23039045?v=3","gravatar_id":"","url":"https://api.github.com/users/mfmasuyama","html_url":"https://github.com/mfmasuyama","followers_url":"https://api.github.com/users/mfmasuyama/followers","following_url":"https://api.github.com/users/mfmasuyama/following{/other_user}","gists_url":"https://api.github.com/users/mfmasuyama/gists{/gist_id}","starred_url":"https://api.github.com/users/mfmasuyama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfmasuyama/subscriptions","organizations_url":"https://api.github.com/users/mfmasuyama/orgs","repos_url":"https://api.github.com/users/mfmasuyama/repos","events_url":"https://api.github.com/users/mfmasuyama/events{/privacy}","received_events_url":"https://api.github.com/users/mfmasuyama/received_events","type":"User","site_admin":false},"repo":{"id":73129660,"name":"spotifyApp","full_name":"mfmasuyama/spotifyApp","owner":{"login":"mfmasuyama","id":23039045,"avatar_url":"https://avatars.githubusercontent.com/u/23039045?v=3","gravatar_id":"","url":"https://api.github.com/users/mfmasuyama","html_url":"https://github.com/mfmasuyama","followers_url":"https://api.github.com/users/mfmasuyama/followers","following_url":"https://api.github.com/users/mfmasuyama/following{/other_user}","gists_url":"https://api.github.com/users/mfmasuyama/gists{/gist_id}","starred_url":"https://api.github.com/users/mfmasuyama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfmasuyama/subscriptions","organizations_url":"https://api.github.com/users/mfmasuyama/orgs","repos_url":"https://api.github.com/users/mfmasuyama/repos","events_url":"https://api.github.com/users/mfmasuyama/events{/privacy}","received_events_url":"https://api.github.com/users/mfmasuyama/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mfmasuyama/spotifyApp","description":null,"fork":true,"url":"https://api.github.com/repos/mfmasuyama/spotifyApp","forks_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/forks","keys_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/teams","hooks_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/hooks","issue_events_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/issues/events{/number}","events_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/events","assignees_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/assignees{/user}","branches_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/branches{/branch}","tags_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/tags","blobs_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/git/refs{/sha}","trees_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/statuses/{sha}","languages_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/languages","stargazers_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/stargazers","contributors_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/contributors","subscribers_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/subscribers","subscription_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/subscription","commits_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/commits{/sha}","git_commits_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/git/commits{/sha}","comments_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/comments{/number}","issue_comment_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/issues/comments{/number}","contents_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/contents/{+path}","compare_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/merges","archive_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/downloads","issues_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/issues{/number}","pulls_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/pulls{/number}","milestones_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/milestones{/number}","notifications_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/labels{/name}","releases_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/releases{/id}","deployments_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/deployments","created_at":"2016-11-07T23:16:34Z","updated_at":"2016-11-09T12:33:03Z","pushed_at":"2016-11-11T20:55:50Z","git_url":"git://github.com/mfmasuyama/spotifyApp.git","ssh_url":"git@github.com:mfmasuyama/spotifyApp.git","clone_url":"https://github.com/mfmasuyama/spotifyApp.git","svn_url":"https://github.com/mfmasuyama/spotifyApp","homepage":null,"size":53,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"mfmasuyama:master","ref":"master","sha":"46e980251f13a6d722e652af6abae849828f0994","user":{"login":"mfmasuyama","id":23039045,"avatar_url":"https://avatars.githubusercontent.com/u/23039045?v=3","gravatar_id":"","url":"https://api.github.com/users/mfmasuyama","html_url":"https://github.com/mfmasuyama","followers_url":"https://api.github.com/users/mfmasuyama/followers","following_url":"https://api.github.com/users/mfmasuyama/following{/other_user}","gists_url":"https://api.github.com/users/mfmasuyama/gists{/gist_id}","starred_url":"https://api.github.com/users/mfmasuyama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfmasuyama/subscriptions","organizations_url":"https://api.github.com/users/mfmasuyama/orgs","repos_url":"https://api.github.com/users/mfmasuyama/repos","events_url":"https://api.github.com/users/mfmasuyama/events{/privacy}","received_events_url":"https://api.github.com/users/mfmasuyama/received_events","type":"User","site_admin":false},"repo":{"id":73129660,"name":"spotifyApp","full_name":"mfmasuyama/spotifyApp","owner":{"login":"mfmasuyama","id":23039045,"avatar_url":"https://avatars.githubusercontent.com/u/23039045?v=3","gravatar_id":"","url":"https://api.github.com/users/mfmasuyama","html_url":"https://github.com/mfmasuyama","followers_url":"https://api.github.com/users/mfmasuyama/followers","following_url":"https://api.github.com/users/mfmasuyama/following{/other_user}","gists_url":"https://api.github.com/users/mfmasuyama/gists{/gist_id}","starred_url":"https://api.github.com/users/mfmasuyama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfmasuyama/subscriptions","organizations_url":"https://api.github.com/users/mfmasuyama/orgs","repos_url":"https://api.github.com/users/mfmasuyama/repos","events_url":"https://api.github.com/users/mfmasuyama/events{/privacy}","received_events_url":"https://api.github.com/users/mfmasuyama/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mfmasuyama/spotifyApp","description":null,"fork":true,"url":"https://api.github.com/repos/mfmasuyama/spotifyApp","forks_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/forks","keys_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/teams","hooks_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/hooks","issue_events_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/issues/events{/number}","events_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/events","assignees_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/assignees{/user}","branches_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/branches{/branch}","tags_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/tags","blobs_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/git/refs{/sha}","trees_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/statuses/{sha}","languages_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/languages","stargazers_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/stargazers","contributors_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/contributors","subscribers_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/subscribers","subscription_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/subscription","commits_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/commits{/sha}","git_commits_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/git/commits{/sha}","comments_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/comments{/number}","issue_comment_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/issues/comments{/number}","contents_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/contents/{+path}","compare_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/merges","archive_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/downloads","issues_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/issues{/number}","pulls_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/pulls{/number}","milestones_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/milestones{/number}","notifications_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/labels{/name}","releases_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/releases{/id}","deployments_url":"https://api.github.com/repos/mfmasuyama/spotifyApp/deployments","created_at":"2016-11-07T23:16:34Z","updated_at":"2016-11-09T12:33:03Z","pushed_at":"2016-11-11T20:55:50Z","git_url":"git://github.com/mfmasuyama/spotifyApp.git","ssh_url":"git@github.com:mfmasuyama/spotifyApp.git","clone_url":"https://github.com/mfmasuyama/spotifyApp.git","svn_url":"https://github.com/mfmasuyama/spotifyApp","homepage":null,"size":53,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mfmasuyama/spotifyApp/pulls/1"},"html":{"href":"https://github.com/mfmasuyama/spotifyApp/pull/1"},"issue":{"href":"https://api.github.com/repos/mfmasuyama/spotifyApp/issues/1"},"comments":{"href":"https://api.github.com/repos/mfmasuyama/spotifyApp/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/mfmasuyama/spotifyApp/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/mfmasuyama/spotifyApp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mfmasuyama/spotifyApp/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/mfmasuyama/spotifyApp/statuses/43c75c38f9e9d29c9fa71d69040db1f729a5412e"}}}}
{"actor":{"display_login":"nicolasepiscopo"}}