Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 推荐用什么方式提交带角js的表单_Angularjs - Fatal编程技术网

Angularjs 推荐用什么方式提交带角js的表单

Angularjs 推荐用什么方式提交带角js的表单,angularjs,Angularjs,使用angularjs提交表单的推荐方式是什么。所有不同的表单字段是否会自动转换为JSON?-1?我不明白你们为什么要试图让外行无法接触到技术,除非你们意识到你们的工作如此简单,以至于你们必须通过人工手段来保护它。 <DOCTYPE html> <html> <head></head> <body> <div ng-app='mymodule' ng-controller="PeopleController as pc">

使用angularjs提交表单的推荐方式是什么。所有不同的表单字段是否会自动转换为JSON?

-1?我不明白你们为什么要试图让外行无法接触到技术,除非你们意识到你们的工作如此简单,以至于你们必须通过人工手段来保护它。
<DOCTYPE html>
<html>
<head></head>
<body>
<div ng-app='mymodule' ng-controller="PeopleController as pc">
<form name="myform" ng-submit="pc.submit(person)">
<input  ng-model="person.name"/>
<input  ng-model="person.age"/>
<input type="submit" />
</form>
</div>

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.0/angular.min.js"></script>
<script>
(function (){
 angular.module('mymodule',[])
 .controller('PeopleController',function($scope,$http) {
   $scope.person={'name':'john'};
   this.submit = function(p){$http.post('/path/to/my.php',p).success(function(e){console.log(e);});};
 });
})();
</script>
</body>
</html>