Here is the array I am working with:
[ { corequisite: "", curriculumYr: "2017-2018", programCode: "ET" majorCode: "AET", prerequisites: "GMRC 101||Math 101" semester: "1st Term", year: "1st Year", subjectCode : "ENG 101", units : "9" }, ... ] <p>I am attempting to group this data by <code>programCode,curriculumYear
andmajorCode
. From there, I want to further group it bySemester
andYear
.Additionally, I am looking to create an array of the
prerequisites
andcorequisites
, splitting the subjects using the delimiter||
.Below is an example of the desired output:
[ curriculumYr: '2017-2018', programCode: 'ET', majorCode: 'ATO' ,{ Sem: [ subjects : [{ Corequisites: ['Subj1','Subj2'], Prequisites: [], subjectCode: "Sample1" }, ...], term: "1st Term" }], [{ subjects: [2nd term subjects here], term: "2nd Term" }] Year: "1st Year" }], ...
The format remains the same for both the 1st and 2nd Years' 1st and 2nd Terms.
Despite attempts using angular-filter and lodash libraries, I have encountered varying results. Any guidance or assistance on this matter would be greatly appreciated!
Thank you in advance for your help!