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