按数据库表中的字段过滤---- angularjs [英] Filter by field in database table----angularjs

查看:63
本文介绍了按数据库表中的字段过滤---- angularjs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人请帮助我理解如何从表格中响应的数据创建新对象。我需要通过已经由另一个字段分组的字段构建过滤器。例如,数据已经按类别字段分组,现在对于每个类别,我需要显示它具有的文档文件的类型。我还需要构建一个函数来调用此字段或索引点击吗?

我得到了以下结构但不知道它是如何工作的,目前它是由不同的字段过滤:



我尝试过:



< 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);}


这篇关于按数据库表中的字段过滤---- angularjs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆