$resource
首先添加$resource的引用
<script src="Scripts/angular.min.js"></script>
<script src="Scripts/angular-resource.min.js"></script>
使用时首先要添加引用
var app = angular.module("myApp", ['ngResource']);
app.controller("myController", function ($scope, $http,$resource) {
var User = $resource('/Home/GetData/:userId', {});
console.log(1)
User.query({ userId: 123 }, function (data) {
console.log(data)
}, function (data) {
console.log(data);
});
}