Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

ng-model-options=“{timezone: 'utc'}” resetting the ng-model value when a bootbox confirm modal is opened #41

Open
akshayfin opened this issue Oct 9, 2019 · 0 comments

Comments

@akshayfin
Copy link

I am using ng-model-options="{timezone: 'utc'}" to show my date in UTC format throughout.But on the same screen I have a button which opens a modal of bootbox and when that is opened the ng-model gets cleared.This is strange as there is no mention of the date in that function.Below is the code.Thanks in advance.

<input ng-model-options="{timezone: 'utc'}"
                                      type="text"  name="creationDate" class="form-control req" uib-datepicker-popup="{{format}}" is-open="popup2.open" datepicker-options="dateOptions1" placeholder="{{vm.user.creationDate | date:'dd/MM/yyyy' : 'UTC'}}"  ng-model="vm.user.creationDate" ng-init="vm.user.creationDate  = vm.user1.creationDate" ng-change="vm.maturity(vm.user.creationDate, 'creationDate')" close-text="Close" alt-input-formats="altInputFormats" readonly="readonly" required />

and the bootbox code:

bootbox.confirm("Are you sure want to delete Test?", function (result) {
      console.log(vm.user);
      if (result == false) {
      return;
      } else {
      let data = Object.assign({}, vm.user);
      data.exposureId = vm.user1._id;
      data.amount = (data.amount + "").split(',').join('');
      UserService.DeleteTest(data).then(response => {
          console.log(response);
          vm.message = response.message;
          vm.show = true;
          $scope.isChecked = false;
          $timeout(function () {
              $scope.isChecked = true;
          }, 4000);
      });
      }
  });


Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant