Skip to content

Navigation Menu

Sign in
Sign up
This repository was archived by the owner on Apr 17, 2025. It is now read-only.
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

Description

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);
 });
 }
 });

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      AltStyle によって変換されたページ (->オリジナル) /