2016-06-15 3 views
0

이온 프레임 워크를 처음 사용했습니다. 저는 하나의 사용자 프로파일을 만들고 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 위치 값이 저장된 데이터베이스는이 URL을 전달하는 방법을 의미한다. 내가 원하는

<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> 

사용자는 세 개의 체크 박스가 PHP는 여러 체크 박스에서와 동일한 데이터베이스 [파트 타임, 풀 타임, 계약]에서 다음과 같이 의미 클릭합니다.

세 개의 확인란에 대해 이미 동일한 모델 이름을 시도했지만 제대로 작동하지 않습니다. 하나를 클릭하면 세 개의 확인란이 모두 클릭되고 데이터베이스 값이 "정의되지 않음"을 의미합니다. 그리고 내가 URL을 아래처럼 통과하면이 시도 하나

답변

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

도와주세요이 [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) 

같은 데이터베이스의 값을 의미한다.

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

관련 문제