search

Home  >  Q&A  >  body text

angular.js - What do the by and for of label group by group for (key,value) in object mean?

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 分别是什么意思呢?

PHPzPHPz2795 days ago1001

reply all(1)I'll reply

  • 某草草

    某草草2017-05-15 17:12:55

    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.

    reply
    0
  • Cancelreply