Fetching recursive elements (categories in categories in...)


#1

Hi there!

I’m new to ember and still struggling, especially since I’m more of a backend developer. Currently I would appreciate some help on the following issue:

I have an endpoint GET /categories that gives me categories and their children like

[{
title: "cat 1",
level: 1,
children: [
    title: "cat 1.1"
    level: 2,
    children: []
]},{
title: "cat 2",
level: 1,
children: [ ... ]
}]

So categories contain categories (could contain categories). Doing multiple requests (level 1 has 9 categories) doesn’t make sense, this is why the backend gives me this structure. Any thoughts or ideas how to implement that?

I can’t even wait for the user to click on a first-level category to load the second-level category for this specific parent because the given layout expects both levels on page load.

Thanks!