angular.js - The interface has three input parameters. One of them is an array. How to transfer using angular?
PHP中文网
PHP中文网 2017-05-15 17:12:12
0
3
619

The interface has three input parameters. One of them is an array. How to transfer using angular

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(3)
给我你的怀抱

You can directly pass the object as a parameter to the $http object

$http({
    method: 'POST',
    url: 'XXX',
    data: {
        'param1':a,
        'param2':b,
        'param3':[]
    }
}).then(function(res)
{
    
})
淡淡烟草味

What kind of interface needs to pass arrays as parameters?
I don’t understand.
I think one of the responsibilities of the front-end is: if the interface provided by the back-end interface is unreasonable, it should be raised and appropriate adjustments should be made.

黄舟

Forcibly convert the string and then convert it back, or simply use your own rules to mark the array with XX, such as ("_") splitting and splicing into strings, and then parsing according to the rules

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template