Javascript 使用ng选项的错误迭代
我有一组描述座位的对象。Javascript 使用ng选项的错误迭代,javascript,html,angularjs,Javascript,Html,Angularjs,我有一组描述座位的对象。 每个座椅对象如下所示: ID: 1 platz: 1 status: 1 title: "Sitzplatz #1" userID: 1 <select ng-options="s.status for s in seating"></select> 现在我使用AngularJS和ng选项在我的对象数组上迭代,如下所示: ID: 1 platz: 1 status: 1 title: "Sitzplatz #1" userID: 1 <
每个座椅对象如下所示:
ID: 1
platz: 1
status: 1
title: "Sitzplatz #1"
userID: 1
<select ng-options="s.status for s in seating"></select>
现在我使用AngularJS和ng选项在我的对象数组上迭代,如下所示:
ID: 1
platz: 1
status: 1
title: "Sitzplatz #1"
userID: 1
<select ng-options="s.status for s in seating"></select>
但我有一个错误:
Error: [$compile:ctreq] http://errors.angularjs.org/1.5.0/$compile/ctreq?p0=ngModel&p1=ngOptions
at Error (native)
at http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:6:416
at s (http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:63:198)
at s (http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:63:265)
at u (http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:66:175)
at g (http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:58:136)
at g (http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:58:153)
at g (http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:58:153)
at g (http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:58:153)
at g (http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:58:153) <div ng-include="'app/shared/modals/adminEditorSeating.html'" class="ng-scope">
错误:[$compile:ctreq]http://errors.angularjs.org/1.5.0/$compile/ctreq?p0=ngModel&p1=ngOptions
错误(本机)
在http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:6:416
在s(http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:63:198)
在s(http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:63:265)
在美国(http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:66:175)
在g(http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:58:136)
在g(http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:58:153)
在g(http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:58:153)
在g(http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:58:153)
在g(http://localhost/netconnect-4.0/assets/scripts/vendor/angular.min.js:58:153)
无论何时使用ng选项,都需要使用ng模型。试试这个
<select ng-model="modelname" ng-options="s.status for s in seating"></select>