ionic表单上的数据怎么获取 博客
1个回答
展开全部
引入服务对象:
app.controller('registerCtrl',['$scope','$kflHttp','$httpParamSerializerJQLike','$ionicModal',function($scope,$kflHttp,$httpParamSerializerJQLike,$ionicModal){
$scope.userInfo = {}; //初始化,重要
$scope.clickRegister = function(){
console.log($scope.userInfo);
var result = $httpParamSerializerJQLike($scope.userInfo);
console.log(result);
}
}]);
html:
<label class="item item-input item-floating-label">
<span class="" name="userName">昵称/手机号/邮箱</span>
<input ng-model="userInfo.name" type="text" placeholder="Your name"/>
</label>
<label class="item item-input item-floating-label">
<span class="">请输入密码</span>
<input ng-model="userInfo.pwd" type="text" placeholder="Your password"/>
</label>
<label class="item item-input item-floating-label">
<span class="">请确认密码</span>
<input ng-model="userInfo.confirmPwd" type="text" placeholder="password confirm"/>
</label>
app.controller('registerCtrl',['$scope','$kflHttp','$httpParamSerializerJQLike','$ionicModal',function($scope,$kflHttp,$httpParamSerializerJQLike,$ionicModal){
$scope.userInfo = {}; //初始化,重要
$scope.clickRegister = function(){
console.log($scope.userInfo);
var result = $httpParamSerializerJQLike($scope.userInfo);
console.log(result);
}
}]);
html:
<label class="item item-input item-floating-label">
<span class="" name="userName">昵称/手机号/邮箱</span>
<input ng-model="userInfo.name" type="text" placeholder="Your name"/>
</label>
<label class="item item-input item-floating-label">
<span class="">请输入密码</span>
<input ng-model="userInfo.pwd" type="text" placeholder="Your password"/>
</label>
<label class="item item-input item-floating-label">
<span class="">请确认密码</span>
<input ng-model="userInfo.confirmPwd" type="text" placeholder="password confirm"/>
</label>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询