search

Home  >  Q&A  >  body text

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

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

PHP中文网PHP中文网2790 days ago637

reply all(3)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-15 17:14:12

    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)
    {
        
    })

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-15 17:14:12

    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.

    reply
    0
  • 黄舟

    黄舟2017-05-15 17:14:12

    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

    reply
    0
  • Cancelreply