![](/img/trans.png)
[英]Angular: prevent re render of component inside it
我正在編寫一個表格組件,需要對我的公司的修改非常開放。 為此,我決定撥打 go: 表.組件.html 在 table.ts 中(只是有趣的代碼): 注射劑是這樣的 accessors 是我創建的自定義類型以保持其可讀性: 通過這段代碼,我可以使用 ngTemplateOutlet,逐行傳遞自定義值 ...
[英]Angular: prevent re render of component inside it
我正在編寫一個表格組件,需要對我的公司的修改非常開放。 為此,我決定撥打 go: 表.組件.html 在 table.ts 中(只是有趣的代碼): 注射劑是這樣的 accessors 是我創建的自定義類型以保持其可讀性: 通過這段代碼,我可以使用 ngTemplateOutlet,逐行傳遞自定義值 ...
[英]Angular 11+ MatDialog: inner component's (ngComponentOutlet) html does not trigger <button (click)="close()"> method. Works on Angular 9
事實上,我在 MatDialog 中嵌入了 ngComponentOutlet 組件時遇到了更多問題。 但讓我們從這里開始。 我正在建造的東西 我想在 MatDialog 中顯示任意組件。 我找到了一種方法,但是雖然它適用於 Angular 9(我找到了一個編寫示例的版本),但它不適用於 Angu ...
[英]No provider for “NgComponentOutlet”
我有一個 Angular 11 應用程序,它導入@angular/material 、 @ngx-translate和一個名為icell-data-table的庫。 從 github 頁面下載示例項目,我能夠在本地環境中沒有任何問題的情況下啟動它。 但是在將其提取到 Stadckblitz 演示時, ...
[英]Angular named router outlet doesn't work as expected
我有一個具有以下路由結構的 angular 項目,從應用程序根開始: 根出口位於AppComponent ,之后ShellComponent包含另一個路由器出口,該出口作為內容傳遞給SidebarComponent , SidebarComponent其顯示在mat-sidenav-conten ...
[英]How to pass html element as child in Angular Higher Order Components (HOC)?
我想在我的 Angular 高階組件中傳遞一個 HTML 元素。 現在我將子元素作為@Input 裝飾器傳遞。 我的 HOC,Main Container 是這樣的。 在其他組件中,我像這樣使用我的 HOC 我當前的代碼: in.ts 文件我像這樣傳遞我的子組件 現在我想做的是,像這樣的 Rea ...
[英]Angular 2, sub-components of dynamic component are not rendered
我正在使用這種方法 將一個組件注入另一個組件,在我的例子中是一個表單到側邊欄。 但是,從注入的組件(表單)中,我無法使用應用程序的管道和共享組件。 在注入的組件中沒有識別出 shared.module 中存在的組件或管道。 如何在通過 ngComponentOutlet 注入的組件中提供共享組件 ...
[英]Angular 7: injection with dependencies for ngComponentOutlet
我需要為我的ngComponentOutlet使用某種@Input()裝飾器。 但似乎 Angular 沒有這個功能。 相反,我想在我的出口組件中傳遞的所有東西都應該通過Injector提供。 如果我想在可注射的 class 中啟動我想要提供的東西,這很好。 但是我需要更深入地研究並在創建 Inje ...
[英]How to assign value of *ngFor loop variable to angular dynamic component's @Input property?
這是對問題的完整重寫,因為它似乎寫得不好。 我正在嘗試使用此軟件包: https://www.npmjs.com/package/ng-dynamic-component 對於具有ngFor循環變量的動態組件@Input()。 包的作者已經回答了一個問題,這似乎為解決我的 ...
[英]How do i Unit test an angular component created with ngComponentOutlet?
我有一個用 ngComponentOutlet 創建的組件 和組件本身 我如何設置單元測試? 我們正在使用 Jest,但我認為設置應該與 Jasmine/Karma 非常相似到目前為止,這是我的單元測試 我遇到了錯誤: 這意味着我不會在創建組件時注入 AdminTableInfo。 有誰知道如何為 ...
[英]How to provide Inputs and Output for dynamic components
我遇到了ng-dynamic-component包,同時在與 Angular 的ngComponentOutlet無法實現的@Input和@Output交互中掙扎。 在我的應用程序中,我想在*ngFor動態實例化不同類型的選項卡組件。 閱讀ng-dynamic-component文檔,與@Inp ...
[英]Angular 4 ngComponentOutlet loads dynamic components, but route content is not being rendered
我正在嘗試加載不同的“父”組件,並通過在每個父組件中定位ng-content將路由內容注入這些不同的父組件。 基本上,每個父組件根據設備寬度(小/移動,中/平板和大/桌面)處理導航和其他樣板材料。 為我的應用程序中的每個路由生成的內容需要被轉換(注入)到父組件中。 每條路線的內容使用n ...
[英]How to ngFor on multiple types of components using ngComponentOutlet?
我有一個類似whatsapp的聊天案例,需要以不同的方式顯示許多類型的消息。 每個都有自己的組件,如TextMessageComponent , FileMessageComponent等。 我希望能夠在我的消息數組上使用ngFor一次,而不必使用ngIf類型。 我聽說ngCo ...