angular.js - What do the by and for of label group by group for (key,value) in object mean?
PHPz
PHPz 2017-05-15 17:10:55
0
1
985

ng-options的语法如下,
对于数组:

label for value in array
select as label for value in array
label group by group for value in array
label disable when disable for value in array
label group by group for value in array track by trackexpr
label disable when disable for value in array track by trackexpr
label for value in array | orderBy:orderexpr track by trackexpr(for including a filter with track by)
对于对象:
label for (key , value) in object
select as label for (key ,value) in object
label group by group for (key,value) in object
label disable when disable for (key, value) in object
select as label group by group for(key, value) in object
select as label disable when disable for (key, value) in object。
其中使用最多的by 和 for 分别是什么意思呢?

PHPz
PHPz

学习是最好的投资!

reply all(1)
某草草

I feel confused. The words by for have no meaning. This is a fixed way of writing. The important thing is to know what label select array and object represent in this fixed expression.
label represents the data displayed on the page,
select represents the selected data,
array and object represent the array or object being traversed.

In this expression, for is followed by each unit traversed from the array or object, and by is connected with group to indicate that a certain field is used as the basis for grouping, which is no different from the database SQL statement.

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