我正在使用一个角度的Typeahead,需要有一个页脚返回的结果,链接到一个完整的高级搜索。我知道我可以使用jquery做到这一点,但我想让它保持完整的角度。
<input type="text" ng-model="spotlightModel" autofocus="autofocus" placeholder="Search" typeahead="searchResult.Description as searchResult for searchResult in getResults($viewValue)"
ypeahead-wait-ms="750" typeahead-template-url="app/views/common/directives/SpotlightSearchResult.html"
typeahead-on-select="onSelect($item)" class="form-control typeahead-input">有什么建议吗?
发布于 2015-09-03 13:14:12
我也有同样的问题。在谷歌了很多次之后,我发现可以覆盖typeahead popup.html的引导模板。
这是原始的答案。https://stackoverflow.com/a/19720026/4704366
基本上,将这段代码放到一个js文件中,以便在ui- js之后加载您的应用程序引导程序。然后将下面的页脚替换为实际的页脚html。
angular.module("template/typeahead/typeahead-popup.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("template/typeahead/typeahead-popup.html",
"<ul class=\"dropdown-menu\" ng-show=\"isOpen() && !moveInProgress\" ng-style=\"{top: position().top+'px', left: position().left+'px'}\" style=\"display: block;\" role=\"listbox\" aria-hidden=\"{{!isOpen()}}\">\n" +
" <li ng-repeat=\"match in matches track by $index\" ng-class=\"{active: isActive($index) }\" ng-mouseenter=\"selectActive($index)\" ng-click=\"selectMatch($index)\" role=\"option\" id=\"{{::match.id}}\">\n" +
" <div typeahead-match index=\"$index\" match=\"match\" query=\"query\" template-url=\"templateUrl\"></div>\n" +
" </li>\n" +
"FOOTER" +
"</ul>\n" +
"");
}]);它有点脏,看起来是一个很好的未来的功能,但它现在可以工作。
https://stackoverflow.com/questions/30087037
复制相似问题