use*_*849 1 web asp.net-web-api angularjs
Angular Post 方法不向 Web api 控制器发送数据。$http 调用 Web api 但它为空。
首先将(Initialize) $FirstName, LastName, Email,定义Number为null。
$scope.FirstName = null;
$scope.LastName = null;
$scope.Email = null;
$scope.Number = null;
Run Code Online (Sandbox Code Playgroud)
或者你可以直接使用$scope.useras
$scope.user = {
id : 0,
FirstName : null,
LastName : null,
Email : null,
Password : null
};
Run Code Online (Sandbox Code Playgroud)
并传入 ng-model 作为user.FirstName
编辑:
在函数$scope.user之外构建CreateUser
$scope.CreatUser=function(){
$http{(...)};
}
Run Code Online (Sandbox Code Playgroud)
电子尼古丁传送系统
| 归档时间: |
|
| 查看次数: |
465 次 |
| 最近记录: |