title: date time picker directive angular js
body: <p>I have made a datetime picker directive</p>
  
  <pre><code> adocsModule.directive('dateTimePicker', ['$timeout', function ($timeout) {
          return {
              link: function (scope, element, attrs, ctrl) {
                  $timeout(function () {
                      element.datetimepicker({
                          //language:  'fr',
                          weekStart: 1,
                          todayBtn: 1,
                          autoclose: 1,
                          todayHighlight: 1,
                          startView: 2,
                          forceParse: 0,
                          showMeridian: 1
                      });
                  }, 10);
                  scope.$apply();
              }
          }
      }]);
  </code></pre>
  
  <p>i have used this directive in html, its working fine but the issue is when i set the value by datetime picker, it never update the ng-model attribute.  i got permision.dateFrom empty in controller. Please help me</p>
  
  <pre><code>&lt;div ng-show="permission.showDuration"&gt;
                          &lt;div class="form-group margin-left-20px margin-top-5px"&gt;
                              &lt;input type="text" date-time-picker class="form-control font-11px input-style1"  placeholder="Select date from" ng-model="permission.fromdate" &gt;
                          &lt;/div&gt;
                          &lt;div class="form-group margin-left-20px margin-top-5px"&gt;
                              &lt;input type="text" date-time-picker class="form-control font-11px input-style1"  placeholder="Select date from" ng-model="permission.todate"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  </code></pre>