0

I'm using jQuery UI datepicker, with an alternative input.

So, when selecting a date from the calendar, an inputs value is set by jQuery.

The value is being updated in the input, but the ng-model is not updating.

<input type="text" name="date"  ng-model="user.date" />
1
  • You should look into using Angular Strap. JQuery isn't really needed when using Angular. Commented Apr 8, 2014 at 15:00

1 Answer 1

2

Try

.trigger('input');

ngModel listens for input event, so to make it work you have to fire an event .

$('input[name="date"]').trigger('input');
Sign up to request clarification or add additional context in comments.

2 Comments

I've thought of this, but it didn't quite seem the angularjs way of things. Is this the best way of doing it? Thanks
@CharliePrynn if you are doing it with jQuery you have do it. or you do all with AngularJs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.