Click here to Skip to main content
15,356,641 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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);}
Posted
Comments
sajeetharan 30-Jun-18 22:56pm
   
Can you create a plunker to reproduce the issue?
Krunal Rohit 1-Jul-18 1:12am
   
Please explain with simple example.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900