{"action":"opened","issue":{"url":"https://api.github.com/repos/Buccaneer/goegefietst/issues/46","repository_url":"https://api.github.com/repos/Buccaneer/goegefietst","labels_url":"https://api.github.com/repos/Buccaneer/goegefietst/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/Buccaneer/goegefietst/issues/46/comments","events_url":"https://api.github.com/repos/Buccaneer/goegefietst/issues/46/events","html_url":"https://github.com/Buccaneer/goegefietst/issues/46","id":143716930,"number":46,"title":"don't use global objects directly","user":{"login":"samvloeberghs","id":231618,"avatar_url":"https://avatars.githubusercontent.com/u/231618?v=3","gravatar_id":"","url":"https://api.github.com/users/samvloeberghs","html_url":"https://github.com/samvloeberghs","followers_url":"https://api.github.com/users/samvloeberghs/followers","following_url":"https://api.github.com/users/samvloeberghs/following{/other_user}","gists_url":"https://api.github.com/users/samvloeberghs/gists{/gist_id}","starred_url":"https://api.github.com/users/samvloeberghs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samvloeberghs/subscriptions","organizations_url":"https://api.github.com/users/samvloeberghs/orgs","repos_url":"https://api.github.com/users/samvloeberghs/repos","events_url":"https://api.github.com/users/samvloeberghs/events{/privacy}","received_events_url":"https://api.github.com/users/samvloeberghs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-26T15:11:28Z","updated_at":"2016-03-26T15:11:28Z","closed_at":null,"body":"For example in:\r\nhttps://github.com/Buccaneer/goegefietst/blob/develop/www/app/geolocation/geolocation.service.js#L35\r\n\r\nthe storage API is accessed directly via the global window object. There are 2 slightly better approaches here:\r\n\r\n1. use the $window angular service - for better testability\r\n2. use a wrapper around localStorage, also for better testability\r\n\r\nUsing the 2nd option, any framework used will most likely wrap the synchronous behaviour in an asynchronous way using promises."}}