Angular UI选择问题

时间:2014-11-20 20:19:14

标签: angularjs angular-ui ui-select

我面临Angular UISelect的问题,并使用uiselect选项将数据绑定到它并重复。

<ui-select class="form-control" ng-model="contractsHeader.AgencyName"   theme="select2" ng-disabled="disabled" style="min-width: 300px;">
                                <ui-select-match placeholder="Select an agency">{{$select.selected.Name}}</ui-select-match>
                                <ui-select-choices repeat="agency in agencies ">
                                    <div ng-bind-html="agency.Name"></div>
                                </ui-select-choices>
                            </ui-select>

我在 Chrome控制台

中看到了以下问题

TypeError: undefined不是函数     在链接(http://cdnjs.cloudflare.com/ajax/libs/angular-ui-select/0.8.3/select.js:924:11)     at nodeLinkFn(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:6579:13)     在compositeLinkFn(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:5986:15)     at nodeLinkFn(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:6573:24)     在compositeLinkFn(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:5986:15)     在publicLinkFn(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:5891:30)     at boundTranscludeFn(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:6005:21)     在controllersBoundTransclude(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:6600:18)     在ngRepeatAction(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:20084:15)     at Object。$ watchCollectionAction [as fn](​​http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:12128:13

IE控制台我看到每个记录即时绑定

TypeError:预期的对象    在链接(http://cdnjs.cloudflare.com/ajax/libs/angular-ui-select/0.8.3/select.js:924:11)    at nodeLinkFn(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:6579:13)    在compositeLinkFn(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:5986:15)    at nodeLinkFn(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:6573:24)    在compositeLinkFn(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:5986:15)    在publicLinkFn(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:5891:30)    at boundTranscludeFn(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:6005:9)    在controllersBoundTransclude(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:6600:11)    在ngRepeatAction(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:20084:15)    at $ watchCollectionAction(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js:12128:13

当我下拉它时,我看不到任何下拉值,但我看到行被绑定,因为当我选择一个值时,它会显示为已选中。

奇怪的是,当我在我的示例应用程序中使用相同的代码时,它就像一个魅力

1 个答案:

答案 0 :(得分:0)

已解决:在我的项目中,我使用角度1.2.16后,我升级到角度1.2.18版本问题得到修复。