My goal is to display all lists and the tasks associated with each list. In my controller, I have the following code:
$http.get('api/list/').success(function (data) {
$scope.lists = data;
$scope.tasks = data[0].Task;
});
While this code successfully works for the first item, I need data[0].Task to be dynamic. The challenge I'm facing is that this code is being called once for each list. I attempted using a variable, but it kept resetting to its original value. I also tried using a callback function, but had no success. I'm unsure of what I might be overlooking or if my approach is fundamentally incorrect.