I think I found the solution:
<td class="calendar-unit" ng-repeat="day in days"
ng-init='getAssignments(employee,day)'
ng-controller='assignmentCtrl'> {{day.date()}} <div class="assignment"
ng-repeat="assignment in assignments"> {{assignment.type}} </div> </td>
In 'assignmentCtrl controller:
$scope.getAssignments= function(emp, d){
$scope.assignments = [];
var temp = $http.get('something.php?emp='+emp+'&d='+d).
then(function(response){
$scope.assignments
= response.data;
return response.data;
});
return temp;
}
As you can see, you will need to create "nested" controller at ng-repeat
top level. Then in "nested" controller, make sure you assign
$scope.assignments so that ng-repeat at child level can access it.
Tan
On Tuesday, May 6, 2014 11:57:55 AM UTC-7, Lovi wrote:
>
> Hi Guys..
> I tried this. did not work for me. My second ng-repeat calls a function
> who has $http request.
>
> like:
> $scope.getAssignments=
> function(emp, d){
> var temp = $http.get('something.php?emp='+emp+'&d='+d).
> then(function(response){
> return response.data;
> });
> return temp;
> }
> any ideas?
> Thanks
>
>> <td class="calendar-unit" ng-repeat="day in days"
>> ng-init='assignments=getAssignments(employee,day)'>
>>> {{day.date()}}
>>> <div class="assignment" ng-repeat="assignment in assignments">
>>> {{assignment.type}}
>>> </div>
>>> </td>
>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.