1
나는 간단한 모달 형식을 가지고 의견을 얻을 수 있습니다. 제출 단추 또는 닫기 단추를 누르면 모달 양식이 닫히지 만 그렇지 않습니다. 다음내이 모달 모달 닫을 수 없습니다
이내 컨트롤러에서 코드입니다 :
$ionicModal.fromTemplateUrl('templates/sharing-comment.html', {
scope: $scope
}).then(function (modal) {
$scope.commentForm = modal;
});
// Triggered in the comment modal to close it
$scope.closeCommentForm = function() {
$scope.commentForm.hide();
};
// Open the comment modal
$scope.showCommentForm = function() {
$scope.commentForm.show();
$scope.popover.hide();
};
The following is code snippet from my modal form:
<ion-modal-view>
<ion-header-bar>
<h1 class="title">Submit Comment on Sharing</h1>
<div class="buttons">
<button class="button button-clear" ng-
click="closeCommentForm()">Close</button>
</div>
</ion-header-bar>
<ion-content>
<form id="commentForm" name="commentForm" ng-submit="submitComment()">
<div class="list">
<label class="item item-input">
<span class="input-label">Your Comment</span>
<textarea type="text" ng-model="mycomment.comment"></textarea>
</label>
<label class="item">
<button class="button button-block button-positive"
type="submit">Submit</button>
</label>
</div>
</form>
</ion-content>
</ion-modal-view>