Async object inside ngxPermissionsOnly doesn't work
See original GitHub issueI’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
###Component
export class MyComponent implements OnChanges {
@Input("id")
id: number;
obj: Object;
ngOnChanges(changes: SimpleChanges) {
this.apiService.getById(changes.id.currentValue)
.takeWhile(() => this.isAlive)
.subscribe(res => {
this.obj= res;
});
}
}
###Template
<div *ngFor="let item of obj?.list">
<!-- 1 IT WORKS!!! -->
<div *ngxPermissionsOnly="['ADMIN']">
Hello World!
</div>
<!-- 2 IT WORKS!!!-->
<button>
{{item.name}}
</button>
<!-- 3 DOES NOT WORK!!! -->
<div *ngxPermissionsOnly="['ADMIN']">
<button>
{{item.name}}
</button>
</div>
</div>
First and Second example works correctly but in third the button appear empty without any text! Why?
Environment
Angular version: 4.4.3
ngx-permissions version: 3.2.4
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
- [ ] Edge version XX
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:10 (4 by maintainers)
Top Results From Across the Web
How make dynamically *ngxPermissionsOnly in angular 5?
I have created a menu dynamically and need to display according to permission but *ngxPermissionsOnly not working. Please suggest what ...
Read more >ngx-permissions - Bountysource
when I add **ngxPermissionsOnly="['ADMIN']"* to app.component.html it works! So It's facing the problem just for child components! I tried many different ways ...
Read more >How to Handle Errors Reactively when Using the Async Pipe
We investigate how to implement a clean and reactive approach to error handling with the async pipe in Angular.
Read more >failed to clear cache. make sure you have the appropriate ...
This is usually as simple as running npm run eject in your project, which will walk you through the process. Make sure to...
Read more >How to handle errors REACTIVELY with the async pipe
In this video, we take a look at how to handle errors from RxJS observable streams reactively when using the async pipe in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@fravezzimattia @kmturley Can you please try with version 6.0.4
Did you try wrap ng-container around it?