{"action":"closed","issue":{"url":"https://api.github.com/repos/chieffancypants/angular-hotkeys/issues/131","labels_url":"https://api.github.com/repos/chieffancypants/angular-hotkeys/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/chieffancypants/angular-hotkeys/issues/131/comments","events_url":"https://api.github.com/repos/chieffancypants/angular-hotkeys/issues/131/events","html_url":"https://github.com/chieffancypants/angular-hotkeys/issues/131","id":59225107,"number":131,"title":"Disabling cheat sheet conditionally","user":{"login":"kandadaboggu","id":185035,"avatar_url":"https://avatars.githubusercontent.com/u/185035?v=3","gravatar_id":"","url":"https://api.github.com/users/kandadaboggu","html_url":"https://github.com/kandadaboggu","followers_url":"https://api.github.com/users/kandadaboggu/followers","following_url":"https://api.github.com/users/kandadaboggu/following{/other_user}","gists_url":"https://api.github.com/users/kandadaboggu/gists{/gist_id}","starred_url":"https://api.github.com/users/kandadaboggu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kandadaboggu/subscriptions","organizations_url":"https://api.github.com/users/kandadaboggu/orgs","repos_url":"https://api.github.com/users/kandadaboggu/repos","events_url":"https://api.github.com/users/kandadaboggu/events{/privacy}","received_events_url":"https://api.github.com/users/kandadaboggu/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-27T11:35:31Z","updated_at":"2015-09-23T10:49:00Z","closed_at":"2015-09-23T10:49:00Z","body":"I want to disable the cheat sheet on public pages and show them on authenticated pages. \r\n\r\nWhen I set `includeCheatSheet` in a `run` block or in a controller the cheat sheet is still shown.\r\n```\r\nApp.run(['hotkeys', 'AuthUser', function(hotkeys, AuthUser) {\r\n  if (AuthUser.authenticated) {\r\n    // add hot keys\r\n  }\r\n  else {\r\n    // the cheat sheet is already added to the DOM. the line\r\n    // below has no impact\r\n    hotkeys.includeCheatSheet = false;\r\n  }\r\n}])\r\n```\r\n\r\nI rely on an authentication service to detect if a user is authenticated. This service is not available in the config block. \r\n\r\n```\r\nApp.config(['hotkeys', function(hotkeys) {\r\n  // can't access the AuthUser service \r\n}]);\r\n```\r\n\r\nHow do I disable cheat sheet in a `controller` or in a `run` block? \r\n "}}