在UI Bootstrap中将模板与Typeahead一起使用

用户名

我正在开发AngularJS应用。我的应用程序有一个插件,可以在这里看到这个应用程式提供了我为另一个专案所提供的服务。该服务如下所示:

myApp.service('myService', ['$http', '$timeout', '$q', function($http, $timeout, $q) {
  this.getResults = function() {
    var deferred = $q.defer();

    var results = [];
    results.push({ name: 'Alpha', id:1, description:'The first' });
    results.push({ name: 'Bravo', id:2, description:'The second' });
    results.push({ name: 'Charlie', id:3, description:'The third' });

    deferred.resolve(results);

    return deferred.promise;
};

我正在尝试在UI Bootstrap框架中使用Typeahead控件我已经成功地整理了基础知识。但是,我无法弄清楚如何使自定义结果模板起作用。我不知道他们从哪里提取属性值。我只是试图创建一个显示名称和描述字段的模板。选择该项目后,我想在文本框中显示名称。我的朋克在这里

除夕

请在这里查看http://plnkr.co/edit/VJFx436Tsew9unXWNQsJ?p=preview

1.在这里设置模板名称,typeahead-template-url="result.html"因此模板脚本的ID必须为"result.html"

  1. 要从模板中的匹配模型访问数据,您需要使用match.model前缀。

    <script type="text/ng-template" id="result.html">
    <a>
      <div><h6>{{match.model.name}}<h6>< /div>
      <div><p>{{match.model.description}}</p></div>
    </a>
    </script>
    

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

在Kendo UI Grid中将column.values与行模板一起使用

来自分类Dev

将Django注册与Flat UI模板一起使用

来自分类Dev

如何在角度1.5中将角度组件与ui.bootstrap.modal一起使用?

来自分类Dev

使Angular UI日历与UI-Bootstrap工具提示一起使用

来自分类Dev

使Angular UI日历与UI-Bootstrap工具提示一起使用

来自分类Dev

Bootstrap插件可以与Angular-UI Bootstrap一起使用吗?

来自分类Dev

Bootstrap插件可以与Angular-UI Bootstrap一起使用吗?

来自分类Dev

如何在Angular-UI模式中将ng-repeat与Div一起使用

来自分类Dev

在ASP.NET MVC中将Kendo MultiSelect与Kendo UI网格一起使用

来自分类Dev

在Angular UI路由器中将$ state方法与$ stateChangeStart toState和fromState一起使用

来自分类Dev

在角度应用程序中将Ui-select与多个类别一起使用

来自分类Dev

格式化一次与ui-bootstrap timepicker一起使用的时间

来自分类Dev

将jQuery UI resizable()与Twitter Bootstrap 3网格类一起使用

来自分类Dev

ng-grid中的UI-Bootstrap Datepicker无法与enableCellEditOnFocus = true一起使用

来自分类Dev

将UI-Bootstrap模态与Angular-Fullstack和ES6一起使用

来自分类Dev

在AngularJS中搜索无法与Angular Bootstrap UI一起使用

来自分类Dev

UI Bootstrap Modal弹出窗口无法与AngularJS一起正常使用

来自分类Dev

ng-grid中的UI-Bootstrap Datepicker无法与enableCellEditOnFocus = true一起使用

来自分类Dev

ui-tabset和bootstrap-daterangepicker不能一起使用吗?

来自分类Dev

angularjs中的选项卡无法与UI-Router和UI-bootstrap一起使用

来自分类Dev

jQuery ui datepicker无法与动态html一起使用

来自分类Dev

将ui-router与视图转换一起使用

来自分类Dev

无法使Swagger UI与Spring Boot一起使用

来自分类Dev

jQuery UI无法与MFC HTMLDialog一起使用?

来自分类Dev

JavaScript无法与jQuery UI一起使用

来自分类Dev

使aurelia-ui-virtualization与表格一起使用

来自分类Dev

将ui:repeat与b:carousel一起使用?

来自分类Dev

如何使Swagger UI与Swashbuckle一起使用端口443?

来自分类Dev

无法使Material UI单选按钮与Formik一起使用

Related 相关文章

  1. 1

    在Kendo UI Grid中将column.values与行模板一起使用

  2. 2

    将Django注册与Flat UI模板一起使用

  3. 3

    如何在角度1.5中将角度组件与ui.bootstrap.modal一起使用?

  4. 4

    使Angular UI日历与UI-Bootstrap工具提示一起使用

  5. 5

    使Angular UI日历与UI-Bootstrap工具提示一起使用

  6. 6

    Bootstrap插件可以与Angular-UI Bootstrap一起使用吗?

  7. 7

    Bootstrap插件可以与Angular-UI Bootstrap一起使用吗?

  8. 8

    如何在Angular-UI模式中将ng-repeat与Div一起使用

  9. 9

    在ASP.NET MVC中将Kendo MultiSelect与Kendo UI网格一起使用

  10. 10

    在Angular UI路由器中将$ state方法与$ stateChangeStart toState和fromState一起使用

  11. 11

    在角度应用程序中将Ui-select与多个类别一起使用

  12. 12

    格式化一次与ui-bootstrap timepicker一起使用的时间

  13. 13

    将jQuery UI resizable()与Twitter Bootstrap 3网格类一起使用

  14. 14

    ng-grid中的UI-Bootstrap Datepicker无法与enableCellEditOnFocus = true一起使用

  15. 15

    将UI-Bootstrap模态与Angular-Fullstack和ES6一起使用

  16. 16

    在AngularJS中搜索无法与Angular Bootstrap UI一起使用

  17. 17

    UI Bootstrap Modal弹出窗口无法与AngularJS一起正常使用

  18. 18

    ng-grid中的UI-Bootstrap Datepicker无法与enableCellEditOnFocus = true一起使用

  19. 19

    ui-tabset和bootstrap-daterangepicker不能一起使用吗?

  20. 20

    angularjs中的选项卡无法与UI-Router和UI-bootstrap一起使用

  21. 21

    jQuery ui datepicker无法与动态html一起使用

  22. 22

    将ui-router与视图转换一起使用

  23. 23

    无法使Swagger UI与Spring Boot一起使用

  24. 24

    jQuery UI无法与MFC HTMLDialog一起使用?

  25. 25

    JavaScript无法与jQuery UI一起使用

  26. 26

    使aurelia-ui-virtualization与表格一起使用

  27. 27

    将ui:repeat与b:carousel一起使用?

  28. 28

    如何使Swagger UI与Swashbuckle一起使用端口443?

  29. 29

    无法使Material UI单选按钮与Formik一起使用

热门标签

归档