我试图从REST API获取该记录, 我婉获取的文本框NG-模糊事件记录,REST API GET方法不给出结果
<div class="col-lg-4">
<input type="text ng-blur="dataTest()" name="id" placeholder="Enter id Number" ng-model="id">
</div>
$http.get('http://192.168.0.103/api/home/Get_OneTime_Info/?User_ID=' +$scope.Id).
success(function (data, status, header, config) {
$scope.Details = data.User_OneTime; //GetAllBolck is the API service name and teh Table is the object name of that api.
alert('Success');
}).
error(function (data, status, header, config) {
alert("error");
但是当我送静态数据到这个服务然后它获取记录。
如果你把“HTTP://192.168。 0.103/api/home/Get_OneTime_Info /?User_ID =在您的浏览器中,API是否发回您期望的内容?如果是这样,这将帮助我们将这个问题解决到AngularJS实现问题。 – Brant
192.168.0.103/api/home/Get_OneTime_Info/?User_ID=1是的,当我发送这个浏览器我会得到结果,但然后我通过身份证使用文本框,然后我可以给结果,我想帮助当我在文本框中输入id时获取结果。 –
问题是,当你在浏览器中调用它时,那条路线是否会返回你想要的数据? – Brant