What does as mean in the following code?
ng-options="option.id as option.title for option in curOptionArray"
option.id means selected, option.title means displayed, as is for this purpose
It can be understood as an ng syntax option.id is the value submitted by select option.title is the value displayed by select option represents the current element in the array curOptionArray
Please refer to the official website: https://docs.angularjs.org/api/ng/directive/ngOptions#!
There is an example:
$scope.items = [{ id: 1, label: 'aLabel', subItem: { name: 'aSubItem' } }, { id: 2, label: 'bLabel', subItem: { name: 'bSubItem' } }]; <select ng-options="item as item.label for item in items track by item.id" ng-model="selected"></select>
You can check out Hacking with Angular: Playing with the ngOptions directive
option.id means selected,
option.title means displayed,
as is for this purpose
It can be understood as an ng syntax option.id is the value submitted by select option.title is the value displayed by select option represents the current element in the array curOptionArray
Please refer to the official website:
https://docs.angularjs.org/api/ng/directive/ngOptions#!
There is an example:
You can check out Hacking with Angular: Playing with the ngOptions directive