Ionic framework 我的房间关不上了

Ionic framework 我的房间关不上了,ionic-framework,modal-dialog,Ionic Framework,Modal Dialog,我有一个简单的模态形式来获取评论。单击“提交”按钮或“关闭”按钮时,模态窗体应该关闭,但它没有关闭 以下是来自我的控制器的代码片段: $ionicModal.fromTemplateUrl('templates/sharing-comment.html', { scope: $scope }).then(function (modal) { $scope.commentForm = modal; }); // Triggered in the comment modal

我有一个简单的模态形式来获取评论。单击“提交”按钮或“关闭”按钮时,模态窗体应该关闭,但它没有关闭

以下是来自我的控制器的代码片段:

 $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>
$ionicModal.fromTemplateUrl('templates/sharing comment.html'{
范围:$scope
}).then(功能(模态){
$scope.commentForm=模态;
});
//在注释模式中触发以关闭它
$scope.closeCommentForm=函数(){
$scope.commentForm.hide();
};
//打开注释模式
$scope.showcomentform=函数(){
$scope.commentForm.show();
$scope.popover.hide();
};
以下是我的模态表单中的代码片段:
提交对共享的评论
接近
你的评论
提交

试试这个,我为你做了codepen

angular.module('ionicApp',['ionic']))
.controller('AppCtrl',函数($scope,$ionicModal){
$ionicModal.fromTemplateUrl('templates/modal.html'{
范围:$scope
}).then(功能(模态){
$scope.commentForm=模态;
});
$scope.createContact=function(){
$scope.commentForm.hide();
};
});

离子模态
联络
新联系人
取消
名字
姓
电子邮件
创造