jgallen23 / toc

Table of Contents Plugin
http://projects.jga.me/toc/
MIT License
531 stars 111 forks source link

Prefix Anchorname with '/' #55

Closed regmish closed 7 years ago

regmish commented 8 years ago

I have an angularjs app and I am using #toc for generating tabel of contents.

I have my hash urls that starts with #/

It looks fine but when navigating to toc anchors, hash url changes only #, this causes me 404 redirection if I want to navigate to other pages starting with #/some-pages

For this I had prefixed toc anchors with prefix : '/' but I get Uncaught Error: Syntax error, unrecognized expression: #/toc-historical-spot,

is there anyway I can fix this.

Thanks in advance.

jgallen23 commented 8 years ago

can you set up a codepen or jsbin so I can understand the issue better?

regmish commented 8 years ago

Its hard for me to reproduce the same problem in codepen, because I have used angularjs, ui-router.

The main problem for me is My regular hash looks like : http://127.0.0.1:8001/#/home

And TOC generated anchors looks like : http://127.0.0.1:8001/#toc-historical

When I click on any of the anchor generated by TOC, I get 404 error thrown by ui-router.

http://youtu.be/j3S8prKLEig

Ahsanmughal commented 7 years ago

I have also the same problem do you find any solution.i am also using angularjs and ui-router.