离子框架中的多个复选框

问题描述:

我是离子框架中的新成员。我创建一个用户配置文件并通过api url(yii2 api)传递用户输入。例如普通的文本字段离子框架中的多个复选框

<input name="location" ng-model="data.location" type="text" placeholder="location" ng-required="true"> 

我的API URL这样

return $http.get('http://localhost/web/index.php?r=apiprofile/new&user_id='+$scope.data.user_id+'&location='+$scope.data.location) 

这是工作的罚款和位置值存储数据库correctly.But我使用了多个复选框指如何通过这个网址。

<ion-checkbox ng-model="data.jobtype1" ng-true-value="'parttime'">parttime</ion-checkbox> 
<ion-checkbox ng-model="data.jobtype2" ng-true-value="'fulltime'">fulltime</ion-checkbox> 
<ion-checkbox ng-model="data.jobtype3" ng-true-value="'contract'">contract</ion-checkbox> 

我想用户点击3个栏表示像这样在数据库[兼职,全职,合同],是相同的PHP多个复选框。

我已经尝试了三个复选框相同的ng-model名称,但它不能正常工作,当我单击任何一个复选框时,意味着所有三个复选框都被单击并且数据库值为“未定义”。我喜欢通过以下网址是指这样的[parttimefulltimecontract]

return $http.get('http://localhost/web/index.php?r=apiprofile/new&user_id='+$scope.data.user_id+'&jobtype='+$scope.data.jobtype1+$scope.data.jobtype2+$scope.data.jobtype3) 

在数据库中的值,请帮助任何一个

<ion-checkbox ng-model="jobtype1" ng-true-value="parttime" ng-false-value="0" ng-checked="jobtype1== parttime" /> 

试试这个。

http://codepen.io/ionic/pen/hqcju