{"action":"created","comment":{"url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/pulls/comments/61266635","id":61266635,"diff_hunk":"@@ -0,0 +1,63 @@\n+angular.module('starter')\n+    // Measurement Service\n+    .factory('unitService', function($http, $q, QuantiModo, localStorageService, $rootScope){\n+        \n+        // service methods\n+        var unitService = {\n+            \n+            // get units\n+            getUnits : function(){\n+                var deferred = $q.defer();\n+\n+                localStorageService.getItem('units',function(units){\n+                    if(units){\n+                        deferred.resolve(JSON.parse(units));\n+                    } else {\n+                        QuantiModo.getUnits(function(units){\n+                            localStorageService.setItem('units',JSON.stringify(units));\n+                            deferred.resolve(units);\n+                        }, function(){\n+                            deferred.reject(false);\n+                        });\n+                    }\n+                });\n+\n+\n+\n+                return deferred.promise;\n+            },\n+\n+            // refresh local units with QuantiModo API\n+            refreshUnits : function(){\n+                localStorage.removeItem('units');\n+                var deferred = $q.defer();\n+\n+                QuantiModo.getUnits(function(units){\n+                    localStorageService.setItem('units',JSON.stringify(units));\n+                    deferred.resolve(units);\n+                }, function(){\n+                    deferred.reject(false);\n+                });\n+\n+                return deferred.promise;\n+            },\n+\n+            searchUnits:function(){\n+                var query = $scope.state.unit_text;\n+                if(query !== \"\"){\n+                    $scope.flags.show_units = true;\n+                    var matches = $scope.state.units.filter(function(unit) {\n+                        return unit.abbreviatedName.toLowerCase().indexOf(query.toLowerCase()) !== -1;\n+                    });\n+\n+                    $timeout(function() {\n+                        $scope.state.searchedUnits = matches;\n+                    }, 100);\n+\n+\n+                } else $scope.state.show_units = false;","path":"www/js/services/unitService.js","position":58,"original_position":58,"commit_id":"263acb4152c25251f4e13ab8f9e892f525e1c9e6","original_commit_id":"d8e56cb140ba8c3867d48eb5232334a3839df26f","user":{"login":"mikepsinn","id":2808553,"avatar_url":"https://avatars.githubusercontent.com/u/2808553?v=3","gravatar_id":"","url":"https://api.github.com/users/mikepsinn","html_url":"https://github.com/mikepsinn","followers_url":"https://api.github.com/users/mikepsinn/followers","following_url":"https://api.github.com/users/mikepsinn/following{/other_user}","gists_url":"https://api.github.com/users/mikepsinn/gists{/gist_id}","starred_url":"https://api.github.com/users/mikepsinn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikepsinn/subscriptions","organizations_url":"https://api.github.com/users/mikepsinn/orgs","repos_url":"https://api.github.com/users/mikepsinn/repos","events_url":"https://api.github.com/users/mikepsinn/events{/privacy}","received_events_url":"https://api.github.com/users/mikepsinn/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Expected { after 'else'.](https://www.codacy.com/app/m_2/QuantiModo-Ionic-Template-App/file/2471037517/issues/source?bid=3248947&fileBranchId=3248952#l58)","created_at":"2016-04-27T14:28:24Z","updated_at":"2016-04-27T14:28:24Z","html_url":"https://github.com/Abolitionist-Project/QuantiModo-Ionic-Template-App/pull/165#discussion_r61266635","pull_request_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/pulls/165","_links":{"self":{"href":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/pulls/comments/61266635"},"html":{"href":"https://github.com/Abolitionist-Project/QuantiModo-Ionic-Template-App/pull/165#discussion_r61266635"},"pull_request":{"href":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/pulls/165"}}},"pull_request":{"url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/pulls/165","id":67581304,"html_url":"https://github.com/Abolitionist-Project/QuantiModo-Ionic-Template-App/pull/165","diff_url":"https://github.com/Abolitionist-Project/QuantiModo-Ionic-Template-App/pull/165.diff","patch_url":"https://github.com/Abolitionist-Project/QuantiModo-Ionic-Template-App/pull/165.patch","issue_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/issues/165","number":165,"state":"open","locked":false,"title":"Feature/new variable reminders","user":{"login":"mikepsinn","id":2808553,"avatar_url":"https://avatars.githubusercontent.com/u/2808553?v=3","gravatar_id":"","url":"https://api.github.com/users/mikepsinn","html_url":"https://github.com/mikepsinn","followers_url":"https://api.github.com/users/mikepsinn/followers","following_url":"https://api.github.com/users/mikepsinn/following{/other_user}","gists_url":"https://api.github.com/users/mikepsinn/gists{/gist_id}","starred_url":"https://api.github.com/users/mikepsinn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikepsinn/subscriptions","organizations_url":"https://api.github.com/users/mikepsinn/orgs","repos_url":"https://api.github.com/users/mikepsinn/repos","events_url":"https://api.github.com/users/mikepsinn/events{/privacy}","received_events_url":"https://api.github.com/users/mikepsinn/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-22T22:25:12Z","updated_at":"2016-04-27T14:28:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee7b2ab1c635e41094076110bca0df587c3c18b2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/pulls/165/commits","review_comments_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/pulls/165/comments","review_comment_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/issues/165/comments","statuses_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/statuses/263acb4152c25251f4e13ab8f9e892f525e1c9e6","head":{"label":"Abolitionist-Project:feature/new_variable_reminders","ref":"feature/new_variable_reminders","sha":"263acb4152c25251f4e13ab8f9e892f525e1c9e6","user":{"login":"Abolitionist-Project","id":5904153,"avatar_url":"https://avatars.githubusercontent.com/u/5904153?v=3","gravatar_id":"","url":"https://api.github.com/users/Abolitionist-Project","html_url":"https://github.com/Abolitionist-Project","followers_url":"https://api.github.com/users/Abolitionist-Project/followers","following_url":"https://api.github.com/users/Abolitionist-Project/following{/other_user}","gists_url":"https://api.github.com/users/Abolitionist-Project/gists{/gist_id}","starred_url":"https://api.github.com/users/Abolitionist-Project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Abolitionist-Project/subscriptions","organizations_url":"https://api.github.com/users/Abolitionist-Project/orgs","repos_url":"https://api.github.com/users/Abolitionist-Project/repos","events_url":"https://api.github.com/users/Abolitionist-Project/events{/privacy}","received_events_url":"https://api.github.com/users/Abolitionist-Project/received_events","type":"Organization","site_admin":false},"repo":{"id":41497171,"name":"QuantiModo-Ionic-Template-App","full_name":"Abolitionist-Project/QuantiModo-Ionic-Template-App","owner":{"login":"Abolitionist-Project","id":5904153,"avatar_url":"https://avatars.githubusercontent.com/u/5904153?v=3","gravatar_id":"","url":"https://api.github.com/users/Abolitionist-Project","html_url":"https://github.com/Abolitionist-Project","followers_url":"https://api.github.com/users/Abolitionist-Project/followers","following_url":"https://api.github.com/users/Abolitionist-Project/following{/other_user}","gists_url":"https://api.github.com/users/Abolitionist-Project/gists{/gist_id}","starred_url":"https://api.github.com/users/Abolitionist-Project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Abolitionist-Project/subscriptions","organizations_url":"https://api.github.com/users/Abolitionist-Project/orgs","repos_url":"https://api.github.com/users/Abolitionist-Project/repos","events_url":"https://api.github.com/users/Abolitionist-Project/events{/privacy}","received_events_url":"https://api.github.com/users/Abolitionist-Project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Abolitionist-Project/QuantiModo-Ionic-Template-App","description":"A generic app that can be easily configured to help the user track and optimize any given outcome variable.","fork":false,"url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App","forks_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/forks","keys_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/teams","hooks_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/hooks","issue_events_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/issues/events{/number}","events_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/events","assignees_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/assignees{/user}","branches_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/branches{/branch}","tags_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/tags","blobs_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/git/refs{/sha}","trees_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/statuses/{sha}","languages_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/languages","stargazers_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/stargazers","contributors_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/contributors","subscribers_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/subscribers","subscription_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/subscription","commits_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/commits{/sha}","git_commits_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/git/commits{/sha}","comments_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/comments{/number}","issue_comment_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/issues/comments{/number}","contents_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/contents/{+path}","compare_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/merges","archive_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/downloads","issues_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/issues{/number}","pulls_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/pulls{/number}","milestones_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/milestones{/number}","notifications_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/labels{/name}","releases_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/releases{/id}","deployments_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/deployments","created_at":"2015-08-27T16:07:22Z","updated_at":"2016-04-23T01:17:55Z","pushed_at":"2016-04-27T14:27:47Z","git_url":"git://github.com/Abolitionist-Project/QuantiModo-Ionic-Template-App.git","ssh_url":"git@github.com:Abolitionist-Project/QuantiModo-Ionic-Template-App.git","clone_url":"https://github.com/Abolitionist-Project/QuantiModo-Ionic-Template-App.git","svn_url":"https://github.com/Abolitionist-Project/QuantiModo-Ionic-Template-App","homepage":"https://quantimo.do","size":77885,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"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":2,"default_branch":"develop"}},"base":{"label":"Abolitionist-Project:develop","ref":"develop","sha":"ead646190c2573ee7009665eca365189382c56e2","user":{"login":"Abolitionist-Project","id":5904153,"avatar_url":"https://avatars.githubusercontent.com/u/5904153?v=3","gravatar_id":"","url":"https://api.github.com/users/Abolitionist-Project","html_url":"https://github.com/Abolitionist-Project","followers_url":"https://api.github.com/users/Abolitionist-Project/followers","following_url":"https://api.github.com/users/Abolitionist-Project/following{/other_user}","gists_url":"https://api.github.com/users/Abolitionist-Project/gists{/gist_id}","starred_url":"https://api.github.com/users/Abolitionist-Project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Abolitionist-Project/subscriptions","organizations_url":"https://api.github.com/users/Abolitionist-Project/orgs","repos_url":"https://api.github.com/users/Abolitionist-Project/repos","events_url":"https://api.github.com/users/Abolitionist-Project/events{/privacy}","received_events_url":"https://api.github.com/users/Abolitionist-Project/received_events","type":"Organization","site_admin":false},"repo":{"id":41497171,"name":"QuantiModo-Ionic-Template-App","full_name":"Abolitionist-Project/QuantiModo-Ionic-Template-App","owner":{"login":"Abolitionist-Project","id":5904153,"avatar_url":"https://avatars.githubusercontent.com/u/5904153?v=3","gravatar_id":"","url":"https://api.github.com/users/Abolitionist-Project","html_url":"https://github.com/Abolitionist-Project","followers_url":"https://api.github.com/users/Abolitionist-Project/followers","following_url":"https://api.github.com/users/Abolitionist-Project/following{/other_user}","gists_url":"https://api.github.com/users/Abolitionist-Project/gists{/gist_id}","starred_url":"https://api.github.com/users/Abolitionist-Project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Abolitionist-Project/subscriptions","organizations_url":"https://api.github.com/users/Abolitionist-Project/orgs","repos_url":"https://api.github.com/users/Abolitionist-Project/repos","events_url":"https://api.github.com/users/Abolitionist-Project/events{/privacy}","received_events_url":"https://api.github.com/users/Abolitionist-Project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Abolitionist-Project/QuantiModo-Ionic-Template-App","description":"A generic app that can be easily configured to help the user track and optimize any given outcome variable.","fork":false,"url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App","forks_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/forks","keys_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/teams","hooks_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/hooks","issue_events_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/issues/events{/number}","events_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/events","assignees_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/assignees{/user}","branches_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/branches{/branch}","tags_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/tags","blobs_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/git/refs{/sha}","trees_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/statuses/{sha}","languages_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/languages","stargazers_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/stargazers","contributors_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/contributors","subscribers_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/subscribers","subscription_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/subscription","commits_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/commits{/sha}","git_commits_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/git/commits{/sha}","comments_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/comments{/number}","issue_comment_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/issues/comments{/number}","contents_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/contents/{+path}","compare_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/merges","archive_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/downloads","issues_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/issues{/number}","pulls_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/pulls{/number}","milestones_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/milestones{/number}","notifications_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/labels{/name}","releases_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/releases{/id}","deployments_url":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/deployments","created_at":"2015-08-27T16:07:22Z","updated_at":"2016-04-23T01:17:55Z","pushed_at":"2016-04-27T14:27:47Z","git_url":"git://github.com/Abolitionist-Project/QuantiModo-Ionic-Template-App.git","ssh_url":"git@github.com:Abolitionist-Project/QuantiModo-Ionic-Template-App.git","clone_url":"https://github.com/Abolitionist-Project/QuantiModo-Ionic-Template-App.git","svn_url":"https://github.com/Abolitionist-Project/QuantiModo-Ionic-Template-App","homepage":"https://quantimo.do","size":77885,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"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":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/pulls/165"},"html":{"href":"https://github.com/Abolitionist-Project/QuantiModo-Ionic-Template-App/pull/165"},"issue":{"href":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/issues/165"},"comments":{"href":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/issues/165/comments"},"review_comments":{"href":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/pulls/165/comments"},"review_comment":{"href":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/pulls/165/commits"},"statuses":{"href":"https://api.github.com/repos/Abolitionist-Project/QuantiModo-Ionic-Template-App/statuses/263acb4152c25251f4e13ab8f9e892f525e1c9e6"}}}}