版本不同,$http.post()这种写法好像会出错。

来源:6-6 用户模块逻辑编写-使用装饰器

北鸟南游

2017-03-31

http://szimg.mukewang.com/58de67410001a1ea07450169.jpg如果是新版本

$http({
 method: 'GET',
 url: '/someUrl'}).then(function(){});

按照这个方式怎么写post呢?

写回答

1回答

慕雪1613582

2017-03-31

$scope.submit = function() {
  $http.post('data/regist.json', $scope.user).then(function(resp) {
    //打印数据
    console.log(resp.data)
  })
}


0
1
北鸟南游
非常感谢!
2017-06-15
共1条回复

Angular JS 仿拉勾网 WebApp 开发移动端单页应用

基于AngularJS,仿拉勾网开发一个招聘类的移动端单页应用

1660 学习 · 857 问题

查看课程