課程
/前端開發
/Angular
/AngularJS實戰
想從$http獲取php里的數據,然后賦值給$scope,顯示到前段,代碼應該怎么寫啊
2016-08-27
源自:AngularJS實戰 3-9
正在回答
$http({
url:'mydata.json',
data:{}
}).success(function(response) {
?????????????????console.log('請求成功!')?;
?? ??? ??? ???? $scope.data = response.data;?? ??? ??? ?}).error(function(response) {?? ??? ??? ??? ?console.log('請求失敗!')?;?? ??? ??? ?});
舉報
一起學習AngularJS的基礎教程,通過實例學習并學會AngularJS
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2016-08-28
$http({
url:'mydata.json',
data:{}
}).success(function(response) {
?????????????????console.log('請求成功!')?;
?? ??? ??? ???? $scope.data = response.data;
?? ??? ??? ?}).error(function(response) {
?? ??? ??? ??? ?console.log('請求失敗!')?;
?? ??? ??? ?});