Reputation: 3
When I use the
<select class="form-control" name="roleId" ng-model="addStaff.roleId"
ng-options="ur.id as ur.name for ur in UserRole">
<option value="">请选择</option>
</select>
the console display angular.js:11598 TypeError: Cannot create property 'roleId' on boolean 'true'
.
If i use the ng-options the same error is displayed.
Upvotes: 0
Views: 51
Reputation: 6628
Try to initialized the object in your angular controller as below.
$scope.addStaff = { roleId : {}};
May be there is possibility of roleId is already defined as boolean in your code. Try to make is as an object.
Upvotes: 1