获取模态输入字段值

时间:2016-04-06 11:58:54

标签: javascript angularjs yeoman angular-fullstack

在yeoman Angular-fullstack中,我有模态服务,它有这个HTML文件。

<div class="modal-header">
  <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">&times;</button>
  <h4 ng-if="modal.title" ng-bind="modal.title" class="modal-title"></h4>
</div>
<div class="modal-body">
  <p ng-if="modal.text" ng-bind="modal.text"></p>
  <div ng-if="modal.html" ng-bind-html="modal.html"></div>
  <div><input type="text" class="form-control" ng-bind="modal.comment" required="required"></div>
</div>
<div class="modal-footer">
  <button ng-repeat="button in modal.buttons" ng-class="button.classes" ng-click="button.click($event)" ng-bind="button.text" class="btn"></button>
</div>

如果单击,是按钮

changeStatusModal.result.then(function(event) {
              console.log( ?? );
            });

如何从Modal获取输入字段(modal.comment)的值到此结果中。那么?

更新我:

这是changeStatusModal代码。

changeStatusModal = openChangeStatusModal({
              modal: {
                dismissable: true,
                title: 'Confirm Change Status to '+statusValue,
                html: '<p>Are you sure you want to change status of claim <strong>' + name.claimId + '</strong> ?</p>',
                buttons: [{
                  classes: 'btn-success',
                  text: 'Change Status',
                  click: function(e) {
                    changeStatusModal.close(e);
                  }
                }, {
                  classes: 'btn-default',
                  text: 'Cancel',
                  click: function(e) {
                    changeStatusModal.dismiss(e);
                  }
                }]
              }
            }, 'modal-info');

0 个答案:

没有答案