![](/img/trans.png)
[英]How to disable mat-autocomplete on formBuilder?
I am trying to create a form in which once an option is selected in the first field, this selection gives the options of the second field, which is ...
[英]How to disable mat-autocomplete on formBuilder?
I am trying to create a form in which once an option is selected in the first field, this selection gives the options of the second field, which is ...
[英]Angular async autocomplete filtering without http request?
我正在嘗試創建一個用戶異步自動完成,如下所示:this.users = this.usersService.getUsers() <input type="text" matInput formControlName="user" [matAutocomplete]="auto"> & ...
[英]How to set a default mat-option value on hover when a mat-autocomplete-panel is opened?
在 Angular 14 中,我使用了 Material 中的 mat-autocomplete 組件。 選擇一個選項后,如果用戶再次單擊自動完成輸入,將再次顯示所有可用選項的下拉列表,但所選選項不在 hover 上。相反,焦點回到了第一個條目列表。 當下拉菜單出現時,我們如何強制特定的 mat- ...
[英]mat-autocomplete options not able to find property
我正在嘗試使用此代碼進行自動完成。 現在,問題是我收到的選項為[object objecct] ,我知道那是因為我需要指定像option.name這樣的字段,但是當我收到does not exist error時。 要檢查我的選項是否為空或不是我打印它。 像下面 output: 在此處輸入圖像描述 ...
[英]How to enable/visible mat-autocomplete only if condition gets true
更新使用THIS解決方案在一個字段中創建用戶輸入彈出表單,嘗試進行自動完成。 我想自動完成功能工作得很好,問題是選項不在輸入框下方。 代碼:<div> <div class="modal-header"> </div> <div class="mo ...
[英]Mat-autocomplete is not working in ngOnInit(), Map() is not working
HTML-我正在嘗試使用 Mat-autocomplete,但它在第一次加載組件時無法正常工作,即在 ngOnInit() 中,它說無法讀取 null 的屬性(讀取“地圖”) TS 文件 - 當我們加載組件時,它第一次無法正常工作,附上錯誤圖像- ...
[英]mat-autocomplete prevent input update
是否有解決方案可以防止 mat-autocomplete 更新 optionSelect 上的輸入? 目標是在用戶輸入一些輸入后獲取建議列表,當用戶從下拉列表中選擇一個元素時隱藏下拉列表,將輸入保留為相同的值並使用所選元素數據執行一些任意操作 ...
[英]How to check if option value was selected? Angular
我需要你的幫助。 我有一個帶有 mat-autocomplete 的模板,我在其中搜索元素並且我有option元素 - 每個單獨的元素。 我的目標是編寫邏輯:如果我選擇了一個元素,我的輸入應該被禁用。 請告訴我如何檢查 mat-autocomplete 中是否選擇了某個元素? 非常感謝) HTM ...
[英]Unable to patchValue matAutocomplete Angular
我需要你的幫助。 我正在使用響應式表單並使用matautocomplete來搜索元素。 我訂閱我的input中的更改以搜索我的項目。 事實是我需要使用patchValue將某個值插入到我的input中。 我嘗試以多種方式做到這一點,但它不起作用。 我究竟做錯了什么? 非常感謝 HTML TS ...
[英]mat-autocomplete selected mat-option pass multiple values from selectedItem
我有一個 mat-autocomplete,它加載 JSON 格式的表數據,當用戶從自動完成中選擇一個項目時,當前將單個 JSON 值映射為選定的“值”。 除了這個值之外,我還需要從這個選定項目的 JSON 節點傳遞一些其他值,因為這些值正在寫入數據庫。 所以我需要來自這個選定對象的 3 個值,而 ...
[英]ngModelChange value undefined when passed to function
我正在使用已連接到 API 的 Angular 自動完成功能。 在開始輸入之前不應返回搜索結果。 在框中鍵入幾個字母后,此錯誤出現在控制台中。 ExpressionChangedAfterItHasBeenCheckedError:表達式在檢查后已更改。 以前的值:'xxxx'。 當前值:'未定義 ...
[英]Angular mat-autocomplete disable input FormControl not working
我正在開發一個自定義組件庫,我們有一個帶有芯片的自定義自動完成組件。 當配置對象中的 disabled 屬性為 true 時,我希望能夠禁用輸入控件。 我試圖在 ngOnInit 中這樣做,但沒有奏效。 HTML ts 這是一個演示https://stackblitz.com/edit/ ...
[英]Angular Material Autocomplete Rounded Corners
我正在使用Angular 材料自動完成功能進行搜索。 我想格式化角落看起來更圓潤,但是我遇到了一些問題。 前兩張圖是我想要的,后兩張是我的嘗試。 我的主要樣式表是 scss,但如果幫助是簡單的 css,我會很樂意接受。 我將毫無問題地轉換以適應 scss 這是我的 HTML 這是我的 SCS ...
[英]Angular Autcomplete Text Box from API Array
我試圖弄清楚如何從 API 對服務器的調用中獲取一個文本框來填充用戶的電子郵件。 選擇-users.component.html: <input type="text" placeholder="Email Search" aria-label="Email" matInput [formC ...
[英]How to get material mat-autocomplete to allow as valid only a value that is in the option collection amd participate in reactive form validation?
我有一個禁用的按鈕,如果用戶鍵入一個有效值,我希望啟用它,所以每次擊鍵我都需要查看它是否匹配.. <mat-form-field appearance="outline" style="width: 100%;"> <mat-label>Vendor</mat-la ...
[英]mat-autocomplete with filter and selected items in mat-table not working
我是 angular 和 angular 材料的新手。 我正在使用教程做一個小項目,其中我有一個 angular 材料自動完成來過濾演員,當我點擊其中一個時,它應該顯示在具有拖放功能的墊表中。 因此,從菜單中 - 首先單擊“創建電影”以查看演員自動完成(有一個添加所選演員的墊表)。 我沒有使用任何數 ...
[英]Mat Autocomplete shows [object object] in the dropdown before the selection
使用{{option.name}}但拋出錯誤 TS2339:“字符串”類型上不存在屬性“名稱”。 我也嘗試過更改值,目前我在列表中有 {option} 以便顯示對象,過濾器、選擇和點擊等所有其他內容都在工作,但顯示,請幫助 import { Component, OnInit } fr ...
[英]mat-autocomplete not filtering with observable
賞金將在 7 天后到期。 此問題的答案有資格獲得+150聲望獎勵。 凱文迪克想引起更多人對這個問題的關注: ...
[英]Make second mat-autocomplete update with filtered data
我有一個帶有數據源集的 Angular 材料表,我正在使用材料表過濾器來過濾數據。 我有幾個材料自動完成,而不是常規輸入,這些自動完成從表中的唯一值源填充他們的選項。 就其本身而言,這些自動完成功能可以很好地工作——如果您在其中搜索一個名稱,選項會過濾到表中可用的內容。 問題出現在多個自動完成中,因 ...
[英]Set initial value in Mat-Autocomplete formArray
我有一個 formArray,它是一個列表,您可以在其中添加、編輯和刪除。 一切正常,但我想為前兩個項目設置初始值。 它適用於輸入值,但我的 mat-autocomplete 沒有正確填充。 這是堆棧閃電戰。 .TS 文件 ...