javascript - jQuery UI Datepicker hash href misinterpreted by AngularJs Routing -


this own fault. did not initialize model datepicker. when datepicker initialized, jquery ui prevents navigation event firing. if you're experiencing problem well, me, you're doing else wrong. leave here cautionary tale.


background:

i trying use jquery ui datepicker plugin within angularjs application.

it single page app uses angular's client side routing (this critical detail).

i using jquery ui v1.8.24 , angularjs v1.2.2

the problem:

in order select date, must click day in calendar. each day in calendar stylized anchor tag href attribute, set hash tag. example, html day 17 in calendar looks this

<a class="ui-state-default" href="#">17</a> 

when user clicks date, angular think trying follow link page found @ route "#/" , dutifully try retrieve page ajax. if exists, show it. if doesn't, user get's nice blank page. obviously, neither want. want angular nothing update model when user clicks date.

attempted solutions:

i have tried using html5 routing (the 1 doesn't use hash tags), doesn't help: instead of trying find different page, angular reloads view on, clobbering changes user may have made.

i have tried editing source code jquery ui datepicker doesn't use hash tag in href. works angular perspective, breaks datepicker. without hashtag, ui datepicker doesn't update properly. also, find solution doesn't involve altering source code jquery ui, if possible.

may has crossed mind. ideally you should use directives in angular ui bootstrap. 1 reason angular ui exist provide angular directives (essentially angular wrappers) commonly used jquery plugins.

in angular ui bootstrap getting started section mentions bootstrap's use of # tags causing problems in angular, , same problem exists jqueryui plugins.

original bootstrap's css depends on empty href attributes style cursors several components (pagination, tabs etc.). in angularjs adding empty href attributes link tags cause unwanted route changes. why need remove empty href attributes directive templates , result styling not applied correctly.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -