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

Unable to make NgxPermissionsService singleton across application and dependent libraries #222

Closed mrgopalakrishnan closed 1 year ago

mrgopalakrishnan commented 1 year ago

I'm trying to use NgxPermissionsService as singleton acroo main app and some libraries. the permissions will be loaded by one library and other libraries and main app has to use the same permissions loaded.

I'm submitting a...


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

Current behavior

Unable to make the service singleton and there is no documentation to explain this scenario.

Expected behavior

Update in the documentation to explain how to share the service and directives across app and libraries

Minimal reproduction of the problem with instructions

Lib Module 

@NgModule({ declarations: [ ], imports: [ HttpClientModule, NgxPermissionsModule ] }) export class MyLibModule{}</code

Main app module

NgxPermissionsModule.forRoot(), MyLibModule.forRoot(),

Environment


Angular version: 15.2.4
ngx-permissions version: 14.0.0


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

@mrgopalakrishnan Sorry can't reproduce

mrgopalakrishnan commented 1 year ago

The issue is with the deep dependencies of the services. solved by providing all dependencies in shared