[英]Angular, ng-templates with if condition
我想根據角色 ID 的變化調用兩個單獨的模板。 我可以得到我的角色 which role as 兩個模板是, 和 ...
[英]Angular, ng-templates with if condition
我想根據角色 ID 的變化調用兩個單獨的模板。 我可以得到我的角色 which role as 兩個模板是, 和 ...
[英]Angular 14 - Remove child component tag from dom
使用Angular 14 我有以下button組件按鈕.component.html<button class="btn btn-{{color}} my-4 mb-2" [class.btn-sm]="size === 'sm'" (click)="onCli ...
[英]How to create a comma seperated list from multiple items in angular?
在我的 angular 應用程序中,我正在嘗試創建一個逗號分隔的值列表,這些值是從我的 API 響應中獲得的。 API 響應如下所示: { "release_date":"2012-03-14", "some_relation":[ { ...
[英]angular 14 template driven Cannot read properties of undefined (reading 'control')
我需要參考我的表格來做一些思考。 這是我的 hmtl 代碼: 我需要參考表格,所以我在我的 ts 中這樣做: 問題是當我需要填寫表格時,它是未定義的。 任何人都可以幫助我嗎? ...
[英]Angular material integrating `ng-content` within popup modal
有一個彈出窗口,它應該包括使用帶有分配 id 的“”的多個組件。 它不工作。 我正在嘗試在包含邊框的 div 內添加一個選定的“標題”。 但不工作。 我很困惑。 需要幫助。 點擊打開按鈕。 直播URL 應用程序.ts 彈出組件: 提前致謝 ...
[英]How to create template reference inside the `ngFor` loop with angular?
我正在嘗試通過ngFor循環創建模板引用。 但不起作用。 ts文件: 模板: 現場演示我收到一個錯誤: Type '{ "": any; }' is not assignable to type 'TemplateRef<any>'. Object literal may only ...
[英]How to bind ngClass with obserable in angular
我有一個類似下面的容器 想在其他標簽中使用可觀察變量,得到一個異常 ...
[英]Angular - Template(input filed) does not reflect value in FormGroup Model
我有一個基於 JSON Shema 的動態生成的 FormGroup: 它在 ngOnInit 上運行,因為組件通過 Input() 獲取 JSON: 在模板方面,我還動態創建元素(為簡單起見,它只有一層深度,並且不像 model 對應物那樣遞歸): 表單正確呈現,任何手動添加新字段都會導致表單控制 ...
[英]Rewrite angular directive which uses template variables
我編寫了一個結構指令,它在我的自定義Select2Component上設置itemTemplate 目前它被這樣使用: 並呈現如下: 我希望能夠使用星號 ( *bsItemTemplate ) 重寫它 ...
[英]show 1 data instead of all ngFor - Angular 11
我正在嘗試使用item.male_students和item.female_students顯示注冊總數更新刪除 ngFor 現在它按預期工作。 這是我的組件。html 更新這是我的 component.ts 我得到 object。 這是來自 api 端點的圖像 更新但我得到了所有的索引。 我只想 ...
[英]Reduce Function in Angular Template
是否可以在 Angular 的 HTML 中執行 reduce 功能? 我在下面做了這個,但它輸出解析錯誤。 HTML TS ...
[英]How to use the common ng-template to navigate to the screens for adding and editing a user?
下面兩個ng-containers用於根據 screenMode 添加用戶並導航到相應的屏幕進行編輯。 因此兩個ng-containers的代碼是相同的,只有第二個錨標簽的文本不同。 而不是一次又一次地編寫相同的代碼,我需要為此使用和通用ng-template 。 因此,如何為此輸入正確的模板? 我 ...
[英]Angular interpolation for variable with percent sign in its name
我需要使用百分號名稱顯示變量的值: Wifi_% 。 當我在模板中使用{{Wifi_%}}時, Failed to compile widget html. Error: Cannot redefine property: ɵfac Failed to compile widget html. ...
[英]Is it possible to use Angular as a binary that generate visualization html?
我有一些 Angular 模板,它們獲取一些數據並組織和可視化數據。 我想在 Angular Web 服務器上提供它,以便其他人可以輸入他們的自定義數據,但有時我也有一個數據列表,我想嘗試將可視化結果保存在磁盤上。 是否可以編寫某種類型的打字稿二進制主腳本,我可以在命令行上調用它,構造一個角度對象 ...
[英]Page Break not working with ngFor in Angular 13
我已經搜索了一些解決方案,但 Angular 13 組件中的分頁符不會分頁。 我正在使用一個簡單的 ng-template(為了便於閱讀,刪除了額外的字段): 模板設置為 ViewChild,如下所示: 數據通過循環傳入和處理 並使用此行調用打印對話框(使用 ngx-print): 數據在打印屏幕 ...
[英]"Property does not exist on type component" error Angular template
我有一個文件platforms.ts ,其中聲明了一個數組,如下所示: 我嘗試在我的 Angular 組件中導入該數組,以便在*ngFor中使用它,例如: 問題是:當直接在 my.ts 文件中聲明platforms object 時,它會起作用,但是當我導入它時,就像import { platfor ...
[英]Angular OnPush: an updated Input string won't update the template
有一個具有默認changeDetection的父組件和兩個具有onPush更改檢測策略的子組件。 在更新輸入變量時,模板不會更新。 我不能在ChildBComponent中使用異步管道,因為它是項目的全局 UI 組件,重構不是一個選項。 我怎么go一下這個? 父母.ts 兒童-ats 子b.ts 我 ...
[英]Angular 11 how to extend a Form from a base component using a child component
我的應用程序有很多費用。 所有費用都具有相同的屬性,除了一些地方和那里。 假設我有這個結構: 假設我想創建一個表單來編輯 BookFee。 內容投影不會起作用,因為不會有任何上下文。 所以我嘗試創建一個嵌入式視圖......但我仍然無法訪問父 FormGroup 到 append 控件。 這是我所 ...
[英]Angular : unable to load component from library : Cannot read properties of null (reading '11')
在我的 Angular 應用程序下我正在嘗試加載從本地 angular 庫中獲取的組件我的組件(來自庫)如下所示: 它的視圖 html看起來像這樣: 在我的主要Angular項目下我通過將 app.module 中的庫作為模塊導入來從庫中獲取它然后,我把它放在我的app.component.htm ...
[英]Angular 12 and custom pipes.... how to?
簡寫: 我收到一個錯誤The pipe 'getListItemText' could not be found 長表: 我需要使用 pipe 將一系列數據對象(一個稍微復雜的 json 對象)轉換為 html 字符串這似乎是 angular 管道的理想選擇! 這個 pipe 非常特定於這個數據, ...