akveo / akveo/nebular

nb-tabset performance issue caused by ng-content

未关闭
#2,347 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
8.1k
派生
1.5k
PR 合并指标
30 天内没有已合并 PR

描述

#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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。