首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Angular Typeahead页脚

Angular Typeahead页脚
EN

Stack Overflow用户
提问于 2015-05-07 04:36:30
回答 1查看 510关注 0票数 2

我正在使用一个角度的Typeahead,需要有一个页脚返回的结果,链接到一个完整的高级搜索。我知道我可以使用jquery做到这一点,但我想让它保持完整的角度。

代码语言:javascript
复制
    <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">

有什么建议吗?

EN

回答 1

Stack Overflow用户

发布于 2015-09-03 13:14:12

我也有同样的问题。在谷歌了很多次之后,我发现可以覆盖typeahead popup.html的引导模板。

这是原始的答案。https://stackoverflow.com/a/19720026/4704366

基本上,将这段代码放到一个js文件中,以便在ui- js之后加载您的应用程序引导程序。然后将下面的页脚替换为实际的页脚html。

代码语言:javascript
复制
 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" +
            "");
    }]);

它有点脏,看起来是一个很好的未来的功能,但它现在可以工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30087037

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档