Tuesday, 10 September 2013

AngularJS and working with js/css libraries that use hash URLs

AngularJS and working with js/css libraries that use hash URLs

I'm using AngularJS with html5 mode on, which is making it difficult for
me to use libraries, Ratchet in particular, that are dependent on using
hash URLs to show/hide information.
Here is an example of a Ratchet Modal:
<a href="#myModal" class="button">Open modal</a>
<div id="myModal" class="modal">
<header class="bar-title">
<h1 class="title">Modal</h1>
<a class="button" href="#myModal">
Close
</a>
</header>
<div class="content content-padded">
<p>The contents of my modal.</p>
</div>
</div>
Clicking on "Open Modal" adds "myModal" to the URL but nothing happens
because, I believe, angular ignores hash URLs.
Any suggestions on how to deal with this? I know people have posted that
they have used angular with ratchet here: does "ratchet" play nicely with
"angular.js" yet? but I can't figure it out.

No comments:

Post a Comment