Hi,
 
    I have created a JQuery calendar control directive andinjected my 
ngModel.
 
       My model is getting updating with my calendar selected value,  but 
datepicker is not updating with changed model value.
 
      I have written like this:
 


           
 restrict: 'EA',

            replace: true,
            
            require: 'ngModel',
            template: '<div><input class="datepicker --input" type="text" 
placeholder="mm/dd/yyyy"><button id="calender" 
class="calendar-button"></button></div>',
            link: function ($scope, $elem, $attrs, ngModelCtrl) {
               -------
 

 $('.datepicker--input').DatePicker({
                        
                       forbiddendays: {
                               range: [],
                                days: List.value
                       },
                           minDate: 0,
                            usedatemask: true,
                            onSelect: function (dateText) { updateModel(
dateText);
                         
                                
        }
 
 var updateModel = function (dateText) {
                 $scope.$apply(function () {
                  ngModelCtrl.$setViewValue(dateText);
         
        });
      };

 
 
Did I miss anything here?

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to