简体   繁体   English

禁用 md-autocomplete 中的项目

[英]disable an item in md-autocomplete

We have a situation where we turned a md-input-container with a md-select / md-option to a md-autocomplete.我们有一种情况,我们将带有 md-select / md-option 的 md-input-container 转换为 md-autocomplete。 In the md-select/md-option we were able to have a ng-disabled property on both the md-select and md-option.在 md-select/md-option 中,我们能够在 md-select 和 md-option 上都有一个 ng-disabled 属性。 For the md-autocomplete we have not found a way to use a ng-disabled at the option/item level.对于 md-autocomplete,我们还没有找到在选项/项目级别使用 ng-disabled 的方法。 We are using it on the md-autocomplete but need to disable options in the drop down once they are selected too.我们在 md-autocomplete 上使用它,但是一旦它们被选中,也需要禁用下拉列表中的选项。

Is there a way to do this using md-autocomplete?有没有办法使用 md-autocomplete 来做到这一点? Thanks!谢谢!

在 md-item-template 上使用这样的东西:

ng-click="item.mail==''?$event.stopPropagation():''"

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

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