Angular高级搜索框不显示suggestedValues

时间:2016-10-19 11:14:22

标签: angularjs advanced-search

我使用Angular advanced searchbox创建了一个搜索框。但是当将suggestedValues添加到范围availableSearchParams时,它不显示建议而我的模态未定义。请让我知道出了什么问题

脚本加载顺序

angular-advanced-searchbox.min.css
angular-advanced-searchbox-tpls.min.js
angular-advanced-searchbox.min.js
app.js // contain app module

HTML

<div class="form-group">
  <label class="col-md-2 col-lg-2 control-label"></label>
    <div class="col-md-10 col-lg-10">
        <nit-advanced-searchbox ng-model="searchParams"  parameters="availableSearchParams" placeholder="Search..."></nit-advanced-searchbox>
        <pre><code>{{searchParams}}</code></pre>
    </div></div>

App.Js

$scope.availableSearchParams = [
    { key: "team", name: "Team", placeholder: "filter by team", restrictToSuggestedValues: true, suggestedValues: ['Berlin', 'London', 'Paris'] },{ key: "testtype", name: "TestType", placeholder: "filter by test type",restrictToSuggestedValues: true, suggestedValues: ['Smoke', 'Regression', 'Benchmark'] }, { key: "text", name: "Text", placeholder: "filter by text" } ];

$scope.$on('advanced-searchbox:modelUpdated', function (event, model) {
                          console.log(model);
                        });

1 个答案:

答案 0 :(得分:0)

在angular-advanced-searchbox:

之前,您必须在模块中包含ui.bootstrap
angular.module('SensacionalApp', [
'ngMaterial',
'ui.bootstrap',
'angular-advanced-searchbox'
]);