我是用jquery请求数据,想通过angularjs渲染到页面上的.....!
世界只因有你2017-05-15 17:12:07
After obtaining the data, apply it to force refresh. I also encountered it a few days ago, and I don't know why. . .
$scope.weather = responseData.data;
$scope.$apply();
================================Supplement================== ===================
After some research in the past two days, it seems that promises other than angularjs are used to make data requests, and angularjs cannot monitor it. Your code uses $.ajax(), so you need to force a refresh. If you use $http.get() to request data, you should not need $apply to refresh.
Also, can you send out your API interface? Just what I need!
淡淡烟草味2017-05-15 17:12:07
You can try this, initialize $scope.weather = {};
at the beginning of the controller function