一、使用$resource
1、引入 angular-resource.min.js
2、定义模块时加载 ngResource var app = angular.module('app',["ngResource"]);
二、支持的方法
支持方法 :
{
'get': {method:'GET'},
'save': {method:'POST'},
'query': {method:'GET', isArray:true},
'remove': {method:'DELETE'},
'delete': {method:'DELETE'}
};
{
'get': {method:'GET'},
'save': {method:'POST'},
'query': {method:'GET', isArray:true},
'remove': {method:'DELETE'},
'delete': {method:'DELETE'}
};