第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

對angular的小疑問

對angular的小疑問

去看天荒地老 2017-01-19 21:30:12
angularJS使用$http.post()往后臺發(fā)送數(shù)據(jù)時,包括{c:$scope.code},但只在input綁定ng-model="code",不申明,不賦值,為什么后臺就接不到c呢?<!DOCTYPE?html> <html?ng-app="test"> <head> <meta?charset="UTF-8"> <title>Document</title> <script?src="angular.js"></script> <script> var?app=angular.module("test",[]); app.controller('get',?['$http','$scope',?function($http,$scope){ $scope.ajax=function?(){ $http.post('a.php',{ a:'123', b:'as', c:$scope.code }).then(function?(res){ console.log(res); },function?(res){ console.log(res); }); }; }]); </script> </head> <body?ng-controller="get"> <input?type="text"?ng-model="code"><button?ng-click="ajax()">點擊</button> </body> </html>
查看完整描述

1 回答

已采納
?
yuanfengjituan

TA貢獻20條經驗 獲得超7個贊

在post之前console打印一下$scope.code;像這樣檢測一下問題在哪就好了

查看完整回答
反對 回復 2017-01-22
  • 1 回答
  • 1 關注
  • 1460 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號