akveo / nebular

:boom: Customizable Angular UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/nebular
MIT License
8.06k stars 1.51k forks source link

Can not use ng-container inside nb-actions #2055

Open s4ch-In opened 5 years ago

s4ch-In commented 5 years ago

Issue type

I'm submitting a feature request

Feature description

Current behavior:

As you already know nb-actions or any other element doesn't support more than one structural directive on the same element, ngFor and nbIsGranted are impossible to use on nb-action as it does not support any kind on wrapper around it.

<nb-actions size="small" class="justify-content-end">
  <nb-action
    *ngFor="let btn of buttons"
    *nbIsGranted="btn.permission"
    (click)="do(btn.key)" 
    [icon]="btn.icon"
    nbPopoverPlacement="bottom">
  </nb-action>
</nb-actions>

Expected behavior:

I would like a wrapper around nb-action like ng-container to handle the scenario which currently breaks the nb-actions

<nb-actions size="small" class="justify-content-end">
  <ng-container *ngFor="let btn of buttons">
    <nb-action 
      (click)="do(btn.key)"
      [icon]="btn.icon"
      *nbIsGranted="btn.permission" 
      nbPopoverPlacement="bottom">
    </nb-action>
  </ng-container>
</nb-actions>

Other information:

npm, node, OS, Browser

<!--
Node, npm: `node --version` and `npm --version`
OS: Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)
Browser: Chrome/Safari/Firefox/etc?
-->

Angular, Nebular

<!--
Check your `package-lock.json` or locate a `package.json` in the `node_modules` folder.
-->
AlviseSembenico commented 3 years ago

Why this issue has been closed? Did you find a solution? In this case, can you post it so also other people can solve the same problem. Thank you

s4ch-In commented 3 years ago

Why this issue has been closed? Did you find a solution? In this case, can you post it so also other people can solve the same problem. Thank you

I stopped working on angular a while ago but I reopened it for you @AlviseSembenico