如何在 mat 中使用 angular 选择嵌套值包含过滤器 [英] How to include filter in mat select nested values using angular

查看:28
本文介绍了如何在 mat 中使用 angular 选择嵌套值包含过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有嵌套下拉菜单的角度材料.以父子为基础嵌套的下拉值.

I'm using angular material with nested dropdowns. The dropdown values nested with parent and child basis.

我面临两个问题.

  1. 自动建议不起作用.如果我输入父名称或其关联的子名称,则必须使用展开模式过滤并显示特定的父视图.

  1. Auto suggestion is not working. If I type parent name or its associated child name, have to filter and show the particular parent view with expand mode.

如果我展开第一个父视图并尝试展开第二个父视图,则在展开第二个父视图时,第一个父视图应自动关闭.

If i expand first parent and trying to expand the second parent, the first parent view should close automatically while expanding the second one.

请找到 stackblitz 链接 https://stackblitz.com/edit/angular-f5mizr-9fpccz 我用它来做样本.

Please find the stackblitz link https://stackblitz.com/edit/angular-f5mizr-9fpccz which i am using to do the sample.

任何人的帮助将不胜感激!!!!

推荐答案

对于您的第一个要求 mat-select 将不起作用.您必须使用 mat-autocomplete.

For your 1st requirement mat-select won't work. You have to use mat-autocomplete.

请在这里找到我的解决方案:https://stackblitz.com/edit/angular-f5mizr-final-flcevo

Please find my solution here: https://stackblitz.com/edit/angular-f5mizr-final-flcevo

这篇关于如何在 mat 中使用 angular 选择嵌套值包含过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆