我已经习惯了 AngularJS ng-resource 但我在序列化数组时遇到了问题。我的 ng-resource 是这样的
app.factory('MyModel', ['$resource', 'api_domain',
function($resource, api_domain) {
return $resource(api_domain + 'adsizes/:id', {
id : '@id'
}, {
get : {method: 'GET', isArray: true }
})
}]);
我的控制器看起来像这样:
app.controller("MyCtrl", ['$scope', 'MyModel',
function($scope, MyModel) {
MyModel.get({
id : id,
'conditions': { 'join' : 'table2'}
}, function() {
});
});
问题是它通过了这样的条件:
conditions:{"join":"table2"}
它将作为必须解码的字符串传递给 php。我的问题是如何将条件作为 php 的关联数组传递?