jQuery ajax request works, same AngularJS ajax request doesn't

后端 未结 1 832
广开言路
广开言路 2020-12-28 19:03

I\'m learning AngularJS and trying to build front-end system that gets data from Wordpress.

On the back-end side everything seems to be set up properly and when I us

相关标签:
1条回答
  • 2020-12-28 19:23

    In the angularjs code, use params: instead of data:.

    In jquery the object supplied to the data: config setting is converted to a query string (?key1=val1&key2=value2) unless you set processData: false. in angularjs, you have to use params: to get a query string, data: is sent as json or string.

    0 讨论(0)
提交回复
热议问题