簡體   English   中英

AngularJS + BootstrapUI:自動完成未加載選項

[英]AngularJS + BootstrapUI : Autocomplete is not loading options

我正在嘗試使用 Ui-Bootstrap 自動完成加載常用名稱。

當我輸入時,我可以看到列表被加載的次數與該字母重復的次數完全相同。 但它沒有顯示名稱。 我可以看到 href 標簽沒有價值!

我肯定在這里錯過了一些東西。 想法?

筆: https://codepen.io/vbbalaji/pen/qBRjRGm

        <span class='py-2 mb-2'>Please enter your name</span>
        <div class='container mb-2'>
            <div class='row'>
                <div class='col-3 text-right py-2 my-1'>Name</div>
                <div class='col-9 vlight-blue py-2 my-1 rounded-lg text-left px-1'>
                    <div class='d-inline-block'>
                        <input type='text' style="text-transform:capitalize;" 
                        id='custName' placeholder='Type your Name' ng-model="CustomerName" value='' 
                        typeahead='name for name in commonNames | filter:$viewValue | limitTo:8' typeahead-show-hint="true" 
                        class="ttInput rounded-lg">
                    </div>
                    <button class='btn btn-xxs btn-danger alignright' ng-click='ClearCustName()'>CLEAR</button>
                </div>
                <button class='btn btn-primary btn-xxs mt-2' id='btnUpd' ng-click="UpdateCurOrder(1)"><i class="fas fa-save px-1"></i>Save</button>
            </div>
        </div>
    </div>
I think you have missed to include required external javascript files reference in the application or html page and same I can see in the provided codepen link.
Include the required external javascript/css reference in head tag of your main page.
For your reference replace your head tag code with below head tag (which has external references) in the codepen and it should work

  <head>
    <style>
        .bgVideo { height: 100vh;}
    </style>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0-rc.2/angular.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0-rc.2/angular-sanitize.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0-rc.2/angular-route.min.js"></script>
    <script src="https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.6.0.js"></script>
    <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
</head>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM