ui select angularjs set maxlength for input value(ui select match) [英] ui select angularjs set maxlength for input value (ui select match)

查看:130
本文介绍了ui select angularjs set maxlength for input value(ui select match)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个额外的属性,就像占位符从ui选择匹配传递一样。我想设置选择输入的最大长度。我可以通过select.min.js添加属性maxlength =来设置它,但我想改变lib。文件不是解决方案。

I want an extra attribute just like "Placeholder" is passing from ui select match. I want to set maxlength of select input. I can set it through select.min.js adding attribute maxlength="" but i think making change to lib. file is not a solution.

就像我输入了adde maxlength =500

请帮帮我。

谢谢

推荐答案

您可以通过templateCache更改属性

You can change attribute through templateCache

.run(function($templateCache) {
        $templateCache.put("bootstrap/select-multiple.tpl.html","<div class=\"ui-select-container ui-select-multiple ui-select-bootstrap dropdown form-control\" ng-class=\"{open: $select.open}\"><div><div class=\"ui-select-match\"></div><input maxlength='5' type=\"search\" autocomplete=\"off\" autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" class=\"ui-select-search input-xs\" placeholder=\"{{$selectMultiple.getPlaceholder()}}\" ng-disabled=\"$select.disabled\" ng-click=\"$select.activate()\" ng-model=\"$select.search\" role=\"combobox\" aria-expanded=\"{{$select.open}}\" aria-label=\"{{$select.baseTitle}}\" ng-class=\"{\'spinner\': $select.refreshing}\" ondrop=\"return false;\"></div><div class=\"ui-select-choices\"></div><div class=\"ui-select-no-choice\"></div></div>");
    })

原始模板可以在文件底部找到select.js

Original templates can be find on bottom of file select.js

这篇关于ui select angularjs set maxlength for input value(ui select match)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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