在ng-submit中关闭模态

时间:2017-11-15 02:24:10

标签: javascript angularjs

我想在callback成功时关闭模态。在我使用ng-clickdata-dismiss="modal"关闭我的模态之前。

如何解决这个问题?

HTML

<form ng-submit="vm.trigTimeOut()">
<h6>
    <label>
        <strong>Time Out </strong>
    </label>
</h6>
<h6>
    <strong>{{ vm.time.timeOut | date: 'hh:mm:ss a' }}</strong>
</h6>
<h6 class="mb-1 row timelist">
    <img ng-src="{{ vm.photo.photo || 'http://www.cdn.innesvienna.net//Content/user-default.png'}}" alt="img" class="img-circular-big">
    <p class="selectedName text-capitalize">
        <strong>{{ vm.userlistData2.firstname + " " + vm.userlistData2.lastname }}
        </strong>
    </p>
</h6>
<div class="form-group">
    <label for="exampleInputEmail1">
        <strong>Password
            <span style="color: red">*</span>
        </strong>
    </label>
    <input type="password" name="password" class="form-control form-control-danger" id="password" placeholder="Password" required
     ng-model="vm.userData2.password">
    <small id="emailHelp" class="form-text text-muted">Enter your password</small>
</div>
<button type="submit" class="btn btn-danger btn-raised btn-block" ng-disabled="credentials.$invalid">
    <strong> proceed</strong>
</button></form>

控制器

userService.timeOut(vm.time).then(function(data) {
  if (data.data.success) {
    console.log('success');
    userService.updateUserV2(updateData).then(function(data) {
      getUsers();
      //close modal here
      logger.success('Successfully Timed Out!');
      vm.userData2 = {};
    });
  } else {
    console.log('error');
  }
});

注意:我没有使用ui-bootstrap

0 个答案:

没有答案
相关问题