[英]Angular Material md-contact-chips autocomplete issue
I have a problem using the md-contact-chips
autocompletion.我在使用
md-contact-chips
自动完成时遇到问题。 I try to catch the $query
as soon as anybody starts typing something.只要有人开始输入内容,我就会尝试捕获
$query
。
HTML HTML
<md-contact-chips
ng-model="members"
md-contacts="querySearch($query)"
md-contact-name="fullname"
md-contact-email="email"
md-contact-image="image"
filter-selected="true"
md-require-match
placeholder="Add members">
</md-contact-chips>
JS JS
$scope.querySearch = function($query) {
console.log($query);
};
When I try to search for additional members (which all are in my $scope.members
) I get this JS error.当我尝试搜索其他成员(都在我的
$scope.members
)时,我收到了这个 JS 错误。
TypeError: $scope.textChange is not a function
I'm using Angular 1.4.1 and Material 0.10.0我正在使用 Angular 1.4.1 和 Material 0.10.0
You can use the workaround suggested on this page by norkunas .您可以使用norkunas 在此页面上建议的解决方法。
Add md-selected-item-change="null" md-search-text-change="null"
to the md-contact-chips element.将
md-selected-item-change="null" md-search-text-change="null"
到 md-contact-chips 元素。
I had the same issue and couldn't figure out why.我有同样的问题,无法弄清楚为什么。 I downgraded my angularjs version to 1.3.15, which is what material.angularjs.org is using.
我将我的 angularjs 版本降级到 1.3.15,这是 material.angularjs.org 正在使用的。 And it works fine.
它工作正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.