Enable Persistence

28 Jun 2017 / 1 minute to read

The value of DateRangePicker can be sustained even after form post back and page refreshing by enabling the enablePersistence API as shown in the below code example.

  • html
  • <div ng-controller="DaterangeCtrl">
         <input type="text" id="daterange" ej-daterangepicker e-width="width" e-enablePersistence="enable" />
  • javascript
  • <script>
        angular.module('syncApp', ['ejangular'])
           .controller('DateRangeCtrl', function ($scope) {
              $scope.width = "600px";
              $scope.enable = true;

    Run the above code to get the below output.

    The DateRangePicker Model value will be stored in local storage / cookies of browser before page refreshes and reinitialized with the restored model after refresh