{"action":"created","issue":{"url":"https://api.github.com/repos/ionic-in-action/chapter5/issues/3","repository_url":"https://api.github.com/repos/ionic-in-action/chapter5","labels_url":"https://api.github.com/repos/ionic-in-action/chapter5/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/ionic-in-action/chapter5/issues/3/comments","events_url":"https://api.github.com/repos/ionic-in-action/chapter5/issues/3/events","html_url":"https://github.com/ionic-in-action/chapter5/issues/3","id":130881797,"number":3,"title":"Make sure the currency exists in the object before trying to access it","user":{"login":"krio","id":178852,"avatar_url":"https://avatars.githubusercontent.com/u/178852?v=3","gravatar_id":"","url":"https://api.github.com/users/krio","html_url":"https://github.com/krio","followers_url":"https://api.github.com/users/krio/followers","following_url":"https://api.github.com/users/krio/following{/other_user}","gists_url":"https://api.github.com/users/krio/gists{/gist_id}","starred_url":"https://api.github.com/users/krio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krio/subscriptions","organizations_url":"https://api.github.com/users/krio/orgs","repos_url":"https://api.github.com/users/krio/repos","events_url":"https://api.github.com/users/krio/events{/privacy}","received_events_url":"https://api.github.com/users/krio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-03T01:36:41Z","updated_at":"2016-03-20T21:06:46Z","closed_at":null,"body":"If the exchange does not return an object for a key we are expecting then some browsers will throw an exception. For example, the exchange is not currently returning results for \"CHF\". This was causing a TypeError and execution was stopped.\r\n\r\n```\r\n$scope.load = function () {\r\n    $http.get('https://api.bitcoinaverage.com/ticker/all').success(function (tickers) {\r\n      angular.forEach($scope.currencies, function (currency) {\r\n        currency.ticker = tickers[currency.code];\r\n        currency.ticker.timestamp = new Date(currency.ticker.timestamp);\r\n      });\r\n    }).finally(function () {\r\n      $scope.$broadcast('scroll.refreshComplete');\r\n    });\r\n  };\r\n```\r\n\r\nMaybe something more like this:\r\n\r\n```\r\nif(tickers.hasOwnProperty(currency.code)) {\r\n  currency.ticker = tickers[currency.code];\r\n  currency.ticker.timestamp = new Date(currency.ticker.timestamp);\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/ionic-in-action/chapter5/issues/comments/199025288","html_url":"https://github.com/ionic-in-action/chapter5/issues/3#issuecomment-199025288","issue_url":"https://api.github.com/repos/ionic-in-action/chapter5/issues/3","id":199025288,"user":{"login":"ahuimanu","id":2949663,"avatar_url":"https://avatars.githubusercontent.com/u/2949663?v=3","gravatar_id":"","url":"https://api.github.com/users/ahuimanu","html_url":"https://github.com/ahuimanu","followers_url":"https://api.github.com/users/ahuimanu/followers","following_url":"https://api.github.com/users/ahuimanu/following{/other_user}","gists_url":"https://api.github.com/users/ahuimanu/gists{/gist_id}","starred_url":"https://api.github.com/users/ahuimanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahuimanu/subscriptions","organizations_url":"https://api.github.com/users/ahuimanu/orgs","repos_url":"https://api.github.com/users/ahuimanu/repos","events_url":"https://api.github.com/users/ahuimanu/events{/privacy}","received_events_url":"https://api.github.com/users/ahuimanu/received_events","type":"User","site_admin":false},"created_at":"2016-03-20T21:06:46Z","updated_at":"2016-03-20T21:06:46Z","body":"This has to be manually changed at the moment, is it possible to update this repo to remove the Swiss Franc?"}}