akveo / akveo/nebular

nb-tabset performance issue caused by ng-content

Offen
#2,347 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
8.1k
Forks
1.5k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

#1473 # Issue type

**I'm submitting a ...** (check one with "x")

* [ ] bug report
* [ *] feature request

### Issue description

Just want to showcase a performance issue for nb-tabset.
nb-tabset use ng-content for content projection.
However, it may cause performance issue due to the nature of ng-content implementation.
Even tab is not active (or *ngIf=false), the tab content will still be initialized.
It may waste a lot of time to render the content of inactive tabs.
https://medium.com/@amcdnl/some-history-263731d328c

Please add this showcase example to your document.
**Current behavior:**
```







```

**Expected behavior:**

add _*ngIf="myTab.active"_ to nb-tab content
```







```

https://medium.com/claritydesignsystem/ng-content-the-hidden-docs-96a29d70d11b

ng-content does not “produce” content, it simply projects existing content. Think of it as some variation of node.appendChild(el) or the well-known JQuery version $(node).append(el): with these methods, the node is not cloned, it is simply moved to its new location. Because of this the lifecycle of the projected content is bound to where it is declared, not where it is displayed.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.