[Solved] how to properly use recursive function to go through multiple nested objects


Change your data to this:

$scope.subjectAreas = [{
    name: "Area-1",
    link: "dashboards.dashboard_1",
    entities: [{
        name: 'entities',
        entities: [{
            name: "entity 1"
        }, {
            name: "entity 2"
        }]
    }, {
        name: 'offerings',
        entities: [{
            name: "offering 1"
        }, {
            name: "offering 2"
        }]
    }]
}, {
    name: "Area-2",
    link: "dashboards.dashboard_1",
    entities: [{
        name: "entity 3"
    }],
    offerings: [{
        name: "offering 3"
    }]
}, {
    name: "Area-3",
    link: "dashboards.dashboard_1",
    entities: [{
        name: "entity 4"
    }, {
        name: "entity 5"
    }, {
        name: "entity 6"
    }],
    offerings: [{
        name: "offering 4"
    }, {
        name: "offering 5"
    }]
}];

I’ve only done the first part, but you can complete the rest.

solved how to properly use recursive function to go through multiple nested objects