angular.js - Some parameters of angular's ng-option option.id as option.title The as in this is
给我你的怀抱
给我你的怀抱 2017-05-15 17:02:25
0
4
653

What does as mean in the following code?

ng-options="option.id as option.title for option in curOptionArray"
给我你的怀抱
给我你的怀抱

reply all(4)
大家讲道理

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>
PHPzhong

You can check out Hacking with Angular: Playing with the ngOptions directive

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template