I have a repeater that shows grades of a class and in my repeater, I have a filter that will give each grade only Shows once. And now I want to show those sections which are in that particular category. For example if I have 2 classes in Class A and Class B Grade 1. I want to show that there are 2 classes in grade I A and B. How do I do this?
As of now the code shows only 1 class in that specific category, not both. How do I create it, only show classes that are mentioned in that class?
EmployeeCtrl.info is an array containing
0: object $$ hashKey:" object: 6 "grade: 1Id:" AA6C05F9-98DF-4A8D-B055- 10DB07557F0D "name:" 1C "TeacherId:" 1E51E989-8ED5-4988-B929-4FBCD8A7977D "__ proto__: Object1: object $$ hashKey:" object 10 "grade: 1Id:" C07D54D9-01B0-4CC8-A8CC-0FDD47EAFE5C " name: "1B" TeacherId: "1E51E989-8ED5-4988-B929-4FBCD8A7977D" __ proto__: Object2: object $$ hashKey: "object: 7" grades: 2Id: "15218673-874B-41C1-9910-AD4F185F5730" Name: "2C" TeacherId: "1E51E989-8ED5-4988-B9 29-4FBCD8A7977D "__ proto__: Object3: Object $$ hashKey:" Object 11 "Grade: 2Id:" 4711EEEE-4B56-4FD8-9A15-648CE00090A3 "Name:" 2A "TeacherId:" Html / repeater code:
snippet "data-lang =" js "Data-hide =" wrong ">
& lt; Div class = "col-md-4 grade select" ng-click = "EmployeeCtrl.ClassClick ()" ng-repeat = "g employee employee_tutorial.info | unique: 'grade' '& gt; & lt; h1 & gt ; Årskurs {{g.Grade}}
/ Div> Filter code:
.filter ('unique', function) {return function (archive, keyname) {var output = [ ], Key = []; angular (for collection, function) {var key = item [keyname]; if (keys.indexOf (key) === -1) {keys.push (key); Output push (item);}} return output;};})
Changed HTML / Repeater Code:
& div; div class = "col-md-4 grade select" NG-Click = "EmployeeCtrl.ClassClick ()" ng-repeat = "g Employees. unique 'grades'' & gt; & lt; h1 & gt; Årskurs {{G.Grade}} & lt; / h1 & gt; & lt; a ng-repeat = "g in EmployeeCtrl.info" & gt; {{g.Name}} & lt; / a & gt; & lt How can I show the names of classes in the same category? / Div> Div>
Try this, the second time you will not actually use the filtered results
& div; div class = "Select-grade-md-4" ng-click = "amplicacheraleal Click on class ("NG-Repeat =" j) Filtrated Grids = (Employer CTNENVEO | Unique: 'Grade') "& gt; & lt; h1 & gt; {{G.Name}} & lt; / a & Gt; & lt; / div & gt;
/ pre>
No comments:
Post a Comment