Multiple directives [datepicker, datepicker] error

505 views
Skip to first unread message

Cecilie Andersen

unread,
Dec 11, 2014, 6:56:26 AM12/11/14
to ang...@googlegroups.com
I am learning using directives and used an example from the AngularJS book, available at GitHub https://github.com/shyamseshadri/angularjs-book/tree/master/chapter8/datepicker.
I get an error running tha app (in Angular 1.3.5): 
 Error: [$compile:multidir] Multiple directives [datepicker, datepicker] asking for new/isolated scope on: <div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)" id="dateField" datepicker="" ng-model="$parent.currentDate" select="updateMyText(date)">

Why is the my app calling the directive two times? How can I fix this?

See plunker for example code. http://plnkr.co/edit/RtuCck6tsqMRGPawKeYB
My code is more extensive so this code only shows how I have configured the datepicker directive in my app.


Regards Cecilie

sandro adamia

unread,
May 11, 2015, 4:05:40 PM5/11/15
to ang...@googlegroups.com
Hi Cecilie
Did u find solution for this problem ?

Cecilie Andersen

unread,
May 11, 2015, 4:31:38 PM5/11/15
to ang...@googlegroups.com
Hi sandro.
I did not find any solution.
I writes in AngularJS so I used ui.bootstrap.datepicker instead. It works great!
https://angular-ui.github.io/bootstrap/
Good luck!

Regards Cecilie

--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/YB6D0you32s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages