大佬教程收集整理的这篇文章主要介绍了angularjs – Angular typeahead,设置自定义弹出模板,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
“typeahead-template-url”指令仅适用于弹出窗口中的每个匹配项.
这是我的代码:
<input class="SELEct-LOCATIOn" id="LOCATIOn" type="text" ng-model="model.LOCATIOn" ng-keypress="keypress($event)" typeahead="match for match in getLOCATIOns($viewvalue)" typeahead-template-url="matchUrl"/>
它们是AngularJS的猴子补丁版本.将来如果要修改其他指令,则在使用.decorator方法时,模式如下.
[nameOfDirective]指令例如:typeaheadPopupDirective
var app = angular.module("monkey",["ui.bootstrap"]); app.config(function ($providE) { $provide.decorator("typeaheadPopupDirective",function ($delegatE) { $delegate[0].templateUrl = "template/typeahead/typeahead-popup-ALTERNATIVE.html"; return $delegate; }); });
这是一个使用原始ui-bootstrap指令的演示.当指令尝试获取新模板URL时,您应该收到404错误.
http://plnkr.co/edit/0mPADZ7D7Eszp07R2g60?p=preview
关于装饰的Official Documentation.
更新
从角度引导程序0.14.x开始,现在支持此功能.在typeahead指令中,您可以使用typeahead-popup-template-url属性指定要用于弹出窗口的模板.
<input type="text" ng-model="SELEcted" typeahead="state for state in states | filter:$viewValue typeahead-append-to-body="true" typeahead-popup-template-url="customPopUp.html" class="form-control">
以上是大佬教程为你收集整理的angularjs – Angular typeahead,设置自定义弹出模板全部内容,希望文章能够帮你解决angularjs – Angular typeahead,设置自定义弹出模板所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。