I suggest you learn about promises and how they work in angular. This is a
pretty classic example of that problem. The var temp in the example isn't
response.data, but a promise that will resolve to response.data.

In oldschool angular (e.g., prior to 1.2), the ui would unwrap such
promises and resolve them to their actual data. They don't do that anymore.
So now, you need to do something like $scope.assignments = response.data
inside the then block on your promise, preferably on the controller or link
function IMO, rather than using ng-init (but that's just an IMO).

e


On Tue, Jul 8, 2014 at 1:41 PM, Tan Vu <[email protected]> wrote:

> I have the same problem.  Any solution on this?
>
> Thanks,
>
> 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.
>

-- 
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.

Reply via email to