I’m having an Angular Js like this
function Ctrl($scope) {
$scope.gardens = [
{garden:'1', trees: ["a", "b", "c", "d"]},
{garden:'2', trees: ["e", "f", "g", "h"]},
{garden:'3', trees: ["i", "k", "l", "m"]}
];
}
Now I want to display it in an html table as follow:
|Garden|Tree| |1 | | |a | | |b | | |c | ... |2 | | |e | | |f | | |g |
I can do this manually with DOM but have no solution with AngularJS.
(What I tried on html code:
<table ng-app="" ng-controller="Ctrl">
<tr ng-repeat="garden in gardens">
<td>{{garden.garden}}</td>
</tr>
</table>
)
Please help!
Johnny
You can do like this:
http://jsfiddle.net/ffVeu/
This is a base, just use it to produce a prettier HTML 😉
HTML
CSS (ugly, just to show the result, do not use this…)