Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Im trying to set the selected date of a Jquery datepicker inside my angular controller

Im doing it with $('#dateFrom').datepicker("setDate", new Date()); When debugging I can see the date is changed correctly, however when the page is finished loading the date is not set any longer. I have tried to step into the angular code and can see it happends when $rootScope.$digest(); is called

share|improve this question
1  
This is not the angular way of doing things. You need to make a directive and use ng-model in the directive. Read the answer on here for an example: stackoverflow.com/questions/18144142/… –  Brian Oct 21 '14 at 10:43
    
Thanks, that did the trick –  CruelIO Oct 21 '14 at 11:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.