有人请帮助我理解如何从表格中响应的数据创建新对象。我需要通过已经由另一个字段分组的字段构建过滤器。例如,数据已经按类别字段分组,现在对于每个类别,我需要显示它具有的文档文件的类型。我还需要构建一个函数来调用此字段或索引点击吗? 我得到了以下结构但不知道它是如何工作的,目前它是由不同的字段过滤: 我尝试过: < ling在typeObj中重复输入[category.category] .subcategories ng-click =show(subcategory,category)> typeObj: 类别:{[类别:{a},类别:{b},类别:{c}} ... $ scope.show(子类别,类别){ $ scope.listOfDocuments = $ scope.typeObj(subcategory,id);}
Does somebody please help me understand how a new object can be created from data responded from a table. I need to build a filter by a field that is already grouped by another one. For example, the data is already grouped by the "category" field and now for each category I need to show the "types" of document files it has. I will also need to build a function to call on click by this field or index? I got the following structure but do not how it is working, currently it is filtering by a different field: What I have tried: <li ng repeat type in typeObj[category.category].subcategories ng-click="show(subcategory, category)> typeObj: categories:{[category:{"a"}, category:{"b"}, category:{"c"}}... $scope.show(subcategory, category){ $scope.listOfDocuments=$scope.typeObj(subcategory, id);}
推荐答案scope.show(子类别,类别){ scope.show(subcategory, category){
scope.listOfDocuments = scope.listOfDocuments=
scope.typeObj(subcategory,id);} scope.typeObj(subcategory, id);}
更多推荐
按数据库表中的字段过滤
发布评论