简体   繁体   English

Angular-如何限制多个 mat-chip 并且无法禁用输入

[英]Angular- How to limit multiple mat-chip and unable to disable the input

This is my stackblitz recreation of a small part of my project.这是我对我项目的一小部分的stackblitz娱乐。 In here I am facing 4 problems:-在这里我面临4个问题:-

  1. I want to limit user to just one mat-chip.我想将用户限制为只有一个垫芯片。 I tried [disabled]="selectedOption >=1" even though this one works, I do not want to disable the remove function so that if the user want he/she can remove the chip and add a new one.我试过[disabled]="selectedOption >=1"即使这个工作,我不想禁用删除 function 以便如果用户想要他/她可以删除芯片并添加一个新的。
  2. In the 2nd input text box, I want to add some kind of line-break.在第二个输入文本框中,我想添加某种换行符。 If you type something in there it just overflows the input in horizontal direction.如果你在那里输入一些东西,它只会在水平方向上溢出输入。
  3. I want to input text in the 2nd input text box from the top of the text-box instead of starting from the middle.我想从文本框顶部的第二个输入文本框中输入文本,而不是从中间开始。
  4. Is it possible to hide the placeholder of the 2nd input text, until we enter something in the 1st input?是否可以隐藏第二个输入文本的占位符,直到我们在第一个输入中输入内容?

Can someone help me with this?有人可以帮我弄这个吗?

Thanks for the help in advance我在这里先向您的帮助表示感谢

I don't think I had understood the second problem, but the others are solved here我认为我没有理解第二个问题,但其他问题在这里解决了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM