Imagine I have a group of Humans who own Cats, and those Cats have Kittens
class Person {
String name;
Cat[] cats;
}
class Cat {
String name;
Kitten[] kittens;
}
class Kitten {
String name;
}
Now I want to display all my Kittens with their Cats and the Owners in an HTML format using Knockout.js:
<!-- ko foreach: persons -->
<!-- ko foreach: cats -->
<!-- ko foreach: kittens -->
<p data-bind="$data.name"></p>
<p data-bind="$parent.name"></p>
<p data-bind="???????"></p> <!-- How do I retrieve the owner's name? -->
<!-- /ko -->
<!-- /ko -->
<!-- /ko -->