angular ui-select not rendering input field

时间:2016-02-25 13:51:53

标签: javascript angularjs angular-ui-bootstrap angular-ui-select

嘿伙计们,我很谨慎,

我有一个有角度的1.4.7项目并想使用'ui.select',但我总是得到这个错误:

Error: [$compile:tpload] http://errors.angularjs.org/1.4.7/$compile/tpload?p0=bootstrap%2Fmatch-multiple.tpl.html&p1=404&p2=Not%20Found
Error: [$compile:tpload] http://errors.angularjs.org/1.4.7/$compile/tpload?p0=bootstrap%2Fchoices.tpl.html&p1=404&p2=Not%20Found
Error: [$compile:tpload] http://errors.angularjs.org/1.4.7/$compile/tpload?p0=bootstrap%2Fselect-multiple.tpl.html&p1=404&p2=Not%20Found

我测试了一切:(

他们在这里讨论问题,但没有解决方案: Github Issue #992

我的index.html js部分(css包含在头部):

<!-- BEGIN CORE ANGULARJS PLUGINS -->
    <script src="plugins/angularjs/angular.min.js" type="text/javascript"></script>
    <script src="plugins/angularjs/angular-sanitize.min.js" type="text/javascript"></script>
    <script src="plugins/angularjs/angular-touch.min.js" type="text/javascript"></script>
    <script src="plugins/angularjs/angular-translate.min.js" type="text/javascript"></script>
    <script src="plugins/angularjs/plugins/angular-translate-loader-static-files.js" type="text/javascript"></script>
    <script src="plugins/angularjs/angular-cookies.min.js" type="text/javascript"></script>
    <script src="plugins/angularjs/plugins/angular-ui-router.min.js" type="text/javascript"></script>
    <script src="plugins/angularjs/plugins/ocLazyLoad.min.js" type="text/javascript"></script>
    <script src="plugins/angularjs/plugins/ui-bootstrap-tpls.min.js" type="text/javascript"></script>
    <script src="plugins/angularjs/plugins/ng-country-select.js" type="text/javascript"></script>
    <script src="plugins/angularjs/plugins/ui-select/select.js" type="text/javascript"></script>
    <!-- END CORE ANGULARJS PLUGINS -->
    <!-- BEGIN JS PLUGINS -->
    <script id="ng_load_scripts_after"></script>
    <!-- END JS PLUGINS -->
    <!-- BEGIN APP LEVEL ANGULARJS SCRIPTS -->
    <script src="js/main.js" type="text/javascript"></script>
    <script src="js/directives.js" type="text/javascript"></script>
    <script src="js/filters.js" type="text/javascript"></script>
    <script src="js/services/AlertService.js" type="text/javascript"></script>
    <script src="js/services/ToastrService.js" type="text/javascript"></script>
    <script src="js/services/RequestService.js" type="text/javascript"></script>
    <!-- END APP LEVEL ANGULARJS SCRIPTS -->

我的指示致电:

<ui-select multiple ng-model="vm.legalbranches">
      <ui-select-match placeholder="Select legalbranch...">{{$item.label}}</ui-select-match>
      <ui-select-choices repeat="legalbranch in legalbranches | filter: {label: $select.search} track by legalbranch.id">
               <span ng-bind="legalbranch.label"></span>
                <!--{{legalbranch.label}}-->
      </ui-select-choices>
</ui-select>

vm.legalbranches和legalbranches通过resolve在控制器中设置。 Legalbranches是一个对象数组。

我在版本0.14.8中使用ui-select和 版本0.14.0中的angular-ui-bootstrap 和角度在1.4.7

黑客是问题???

编辑: 这是加载网站后dom的结果:

<ui-select multiple="" ng-model="vm.legalbranches" class="ng-pristine ng-untouched ng-valid ng-scope"></ui-select>

1 个答案:

答案 0 :(得分:0)

我正在使用oclazyload,我做了以下操作以使ui选择运行:

                    {
                        name: 'ui.select',
                        insertBefore: '#ng_load_plugins_before', // load the above css files before '#ng_load_plugins_before'
                        files: [
                            'plugins/angularjs/plugins/ui-select/select.min.css',
                            'plugins/angularjs/plugins/ui-select/select.js' //use the non minify because we have custom edits in it
                        ]
                    },

我在名称字段中使用了我的应用名称,但我不得不使用ui.select

请求帮助