Angularjs's array of objects is not working in

2019-09-05 18:51发布

问题:

I am pushing the http.get() methods result in a new array. On backend I have django. I tried to display the content of array in UI using ng-repeat. Its working absolutely fine with Firebox, Chrome. In safari it's displaying nothing. Even if I console the array in controller, it's displaying an empty array. There is no error in console.log safari. The console.log(data) for data from http.get() request,is showing empty in safari but in chrome and firebox its showing the expected results.

So is it problem of my code or this issue is related to Safari??

回答1:

Whenever you use API call, like http.get('api/users/') use / to end of every http-url.