ng-model, ng-bind and ui-date

680 views
Skip to first unread message

Lutz Epperlein

unread,
Sep 18, 2012, 11:28:04 AM9/18/12
to ang...@googlegroups.com
I have some troubles to get the datepicker of the angular-ui framework to work. I use 
<input ui-date ng-model="project.due" value={{project.due}} ... />
This leads to calling two watchers in $digest(), first for 
watch.get.exp == "project.due" 
the second for 
watch.get.exp == "{{project.due}}".
The first watcher sets the correct date string, the second one fills in some ISO formatted string. And because $digest() iterates about the watchers form highest index to the lowest the wrong watcher wins. An example can be found here: http://plnkr.co/edit/NvLgzw
What I'm doing wrong?

Lutz 

Peter Bacon Darwin

unread,
Sep 18, 2012, 3:29:41 PM9/18/12
to ang...@googlegroups.com
You do not need to set the value attribute.
Pete


Lutz 

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en.
 
 

Lutz Epperlein

unread,
Sep 19, 2012, 4:54:30 AM9/19/12
to ang...@googlegroups.com
Thanks again Pete.

Can you try this one:  http://plnkr.co/edit/QoUS9X?p=preview
It uses the latest version of the date picker.

I tested it and it works! Many thanks. 
And I detected the changes in the new date picker are already incorporated in the angular-ui.js. At least with the current "https://raw.github.com/angular-ui/angular-ui/master/build/angular-ui.min.js" it works too.
I will test it with my app and I hope it will do the right things too.
Lutz


Peter Bacon Darwin

unread,
Sep 19, 2012, 5:09:39 AM9/19/12
to ang...@googlegroups.com
I just pushed out a new version 0.2.1, in the last few minutes so you are probably pulling that in now :-)

Reply all
Reply to author
Forward
0 new messages