2015-01-30 3 views
0

나는 이오니아 초기이다.이오니아 팝업 닫기 내가 옵션을 선택했을 때

필자는 팝업 형식의 이온을 만들어 냈습니다. 하지만 뭔가 문제가 생겼어. 내가 선택을 한 후에 (입력 라디오로), 팝업이 닫히고 클래스에 태그를 바꾼다.

.controller('PlaylistsCtrl',function($scope, $ionicPopup, $timeout) { 

// Triggered on a button click, or some other target 
$scope.showPopup = function() { 
$scope.data = {} 

// An elaborate, custom popup 
var myPopup = $ionicPopup.show({ 
templateUrl: 'templates/Popuptes.html', 
scope: $scope, 
}); 

myPopup.then(function(res) { 
console.log('Tapped!', res); 
}); 

$timeout(function() { 
    myPopup.close(); //close the popup after 10 seconds for some reason 
}, 6000); 

}; 

}); 

을이 내 Popuptes.html :

이 내 코드 팝업에 대한 app.js

<div id="popup"> 

<input type="text"> 
<br> 
<input type="radio" name="tags" value="food" ng-model="data.tags">Food 
<br> 
<input type="radio" name="tags" value="drink" ng-model="data.tags">Drink 
<br> 
<a href="#">Show all..</a> 


</div> 

누구든지 나를 도울 수 있습니까? 감사합니다. 안부 인사 :

답변

3

'myPopup.close();'를 사용할 수 있습니다. 당신이 선택을 한 후에 팝업을 닫을 수 있습니다. (즉, JQuery에서 라디오 선택 이벤트를 수신)하고 클래스를 계속 변경하십시오.

자동 닫기를 제거했는지 확인하십시오.

$timeout(function() { 
myPopup.close(); //close the popup after 6 seconds for some reason 
}, 6000); 
//remove this. 
0

<input type="radio" name="tags" value="food" ng-model="data.tags">Food 당신은 변화하지 이유를 묻는 경우,이 새 값으로 할당됩니다 ng-model="data.value"을 제공합니다. 그래서 나는 다시 반사 될 것이다.