AlexKhymenko / ngx-permissions

Permission and roles based access control for your angular(angular 2,4,5,6,7,9+) applications(AOT, lazy modules compatible
MIT License
936 stars 126 forks source link

Can't bind to 'ngxPermissionsOnly' since it isn't a known property of 'div' #204

Closed fritzwf closed 1 year ago

fritzwf commented 1 year ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X ] Bug report  
[ ] Feature request
[ ] Documentation issue or request

Current behavior

I have the same issue as: https://github.com/AlexKhymenko/ngx-permissions/issues/114

Expected behavior

I am using Angular 14 and I am using: "ngx-permissions": "~14.0.0" I should be able to do:

<div *ngxPermissionsOnly="['ADMIN']">
    <div>You can see this text congrats</div>
</div>

BTW, I have only one module and the permission work fine with the router.

Minimal reproduction of the problem with instructions

The specific exact error is:

admin-only.component.html:2 NG0303: Can't bind to 'ngxPermissionsOnly' since it isn't a known property of 'ng-template' (used in the 'AdminOnlyComponent' component template).

  1. If 'ng-template' is an Angular component and it has the 'ngxPermissionsOnly' input, then verify that it is a part of an @NgModule where this component is declared.
  2. If 'ng-template' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

Environment

Windows 10


Angular version: 14
ngx-permissions version: ~14.0.0

None
Browser:
- [ X] Chrome (desktop) version Version 105.0.5195.102
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX            
AlexKhymenko commented 1 year ago

@fritzwf Did You do the solution of the same issue as: https://github.com/AlexKhymenko/ngx-permissions/issues/114

fritzwf commented 1 year ago

@AlexKhymenko Yes, that didn't work, I don't have a shared module. I created an angular app to test it.

https://github.com/fritzwf/ngx-permissions-test

AlexKhymenko commented 1 year ago

@fritzwf I dont understand it. Please look into the wiki or youtube how to install the library.

fritzwf commented 1 year ago

Thanks, will do.

fritzwf commented 1 year ago

I had a missing import!

AlexKhymenko commented 1 year ago

@fritzwf Good job