{"action":"closed","issue":{"url":"https://api.github.com/repos/AlexKhymenko/ngx-permissions/issues/72","repository_url":"https://api.github.com/repos/AlexKhymenko/ngx-permissions","labels_url":"https://api.github.com/repos/AlexKhymenko/ngx-permissions/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/AlexKhymenko/ngx-permissions/issues/72/comments","events_url":"https://api.github.com/repos/AlexKhymenko/ngx-permissions/issues/72/events","html_url":"https://github.com/AlexKhymenko/ngx-permissions/issues/72","id":347687437,"node_id":"MDU6SXNzdWUzNDc2ODc0Mzc=","number":72,"title":"Usage question - ngxPermission directive","user":{"login":"architechcro","id":591108,"node_id":"MDQ6VXNlcjU5MTEwOA==","avatar_url":"https://avatars3.githubusercontent.com/u/591108?v=4","gravatar_id":"","url":"https://api.github.com/users/architechcro","html_url":"https://github.com/architechcro","followers_url":"https://api.github.com/users/architechcro/followers","following_url":"https://api.github.com/users/architechcro/following{/other_user}","gists_url":"https://api.github.com/users/architechcro/gists{/gist_id}","starred_url":"https://api.github.com/users/architechcro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/architechcro/subscriptions","organizations_url":"https://api.github.com/users/architechcro/orgs","repos_url":"https://api.github.com/users/architechcro/repos","events_url":"https://api.github.com/users/architechcro/events{/privacy}","received_events_url":"https://api.github.com/users/architechcro/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-08-05T10:40:46Z","updated_at":"2018-10-13T14:54:56Z","closed_at":"2018-10-13T14:54:56Z","author_association":"NONE","body":"\r\n## I'm submitting a\r\n<!-- Check one of the following options with \"x\" -->\r\n<pre><code>\r\n[ ] Regression (a behavior that used to work and stopped working in a new release)\r\n[ ] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->\r\n[ ] Feature request\r\n[ x ] Documentation issue or request\r\n</code></pre>\r\n\r\n## Current behavior\r\nngxPermissionOnly directive syntax is not working as described in documentation. I've tested several syntax cases and only one that works throws typescript error\r\ntested: \r\n\r\n```\r\n     1. <div *ngxPermissionsOnly=\"['GUEST']\">GUEST</div>\r\n     2. <div *ngxPermissionsOnly=\"GUEST\">GUEST - 2</div>\r\n     3. <div *ngxPermissionsOnly=\"'GUEST'\">GUEST - 3</div>\r\n     4. <div *ngxPermissionsOnly=\"['GUEST']\">GUEST - 4</div>\r\n     5. <div *ngxPermissionsOnly=\"['ADMIN']\">ADMIN</div>\r\n     6. <div *ngxPermissionsOnly=\"['USER']\">USER</div>\r\n     7. <div *ngxPermissionsOnly=\"'GUEST', 'ADMIN'\">GUEST, ADMIN - 3</div>\r\n```\r\n\r\n\r\nOnly GUEST-2 ( example 2. ) is displayed, but there is a build error: \r\n[Angular] Identifier 'GUEST' is not defined. The component declaration, template variable declarations, and element references do not contain such a member\r\n\r\nI've tried several more syntax combinations and only permissions without '' work. e.g. \r\n*ngxPermissionsOnly=\"GUEST\"\r\n*ngxPermissionsOnly=\"[ADMIN, GUEST]\"\r\n\r\n## Expected behavior\r\n\r\nExamples 1., 3., 4., 5., 6., 7. should work ( depending on the active roles )\r\n\r\n## Minimal reproduction of the problem with instructions\r\n\r\nInstallation done as described.\r\nRoles assigned \r\n\r\n`rolesService.addRole(element.roleName, element.permissions);`\r\n\r\nRoles service returns assigned roles as expected\r\n```\r\n    this.rolesService.roles$.subscribe( res => {\r\n      this.roles = res;\r\n    });\r\n```\r\n\r\n## Environment\r\n\r\n<pre><code>\r\nAngular version: 6.0.1\r\nngx-permissions version: 5.0.0\r\n<!-- Check whether this is still an issue in the most recent ngx-permissions version -->\r\n\r\nBrowser:\r\n- [x ] Chrome (desktop) version 67.0.3396.99 (Official Build) (64-bit)\r\n- [ x] Chrome (Android) version 68.0.3440.85\r\n- [ ] Chrome (iOS) version XX\r\n- [ ] Firefox version XX\r\n- [ ] Safari (desktop) version XX\r\n- [ ] Safari (iOS) version XX\r\n- [ ] IE version XX\r\n- [ ] Edge version XX"}}
{"actor":{"display_login":"AlexKhymenko"}}