SAP Spartacus outlet.directive.ts里this.templateRef的来源
生活随笔
收集整理的這篇文章主要介紹了
SAP Spartacus outlet.directive.ts里this.templateRef的来源
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
如源代碼所示:
這個templateRef是構造函數注入進去的:
如圖:
這里謎底揭開了。只有加入cxOutlet之后,我們自定義實現Outlet.directive.ts里的create方法,下面這段代碼,才會觸發下面cx-page-slot child view的渲染:
const view = this.vcr.createEmbeddedView(<TemplateRef<any>>tmplOrFactory,{$implicit: this.cxOutletContext,});vcr:view container reference,createEmbeddedView方法,創建view后,立即render該view:
更多Jerry的原創文章,盡在:“汪子熙”:
總結
以上是生活随笔為你收集整理的SAP Spartacus outlet.directive.ts里this.templateRef的来源的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 不主动不拒绝不负责是什么梗 不主动不拒绝
- 下一篇: 永祥股份股票代码