9

I have a single page application that really just has one single page. There's just the one view that has lots of javascript/ajax logic done with angularjs, but there's no routing to other views involved.

Therefore I'd like to git rid of the hashbang (#/) at the end of the url. Can I somehow turn off angularjs routing completely?

Btw: I know about Htm5Mode, but I want it to work in all browsers.

chris
  • 2,467
  • 2
  • 25
  • 25

1 Answers1

2

If you don't have a $routeProvider defined, there will be no routing, and therefore no hash in your url.

John Woodruff
  • 1,608
  • 16
  • 29
  • 13
    This is not the case. Hash urls are modified by angular even if the ng app does not use the router. – Grae Kindel Nov 06 '13 at 20:46
  • 4
    Agreed. It appears that `ng-include` will turn on routing, even when you use no other Angular features. Are you using `ng-include`? – Sharky Mar 26 '14 at 19:17
  • @Sharky did you find a way to avoid this behavior when using ng-include? I have a single-page parallax using controllers but not routing, and when using ng-include angular replaces anchor url from this #clients to this #/clients – edrian Nov 04 '15 at 12:47
  • I did, but unfortunately, I no longer remember how I did it. But I can tell you for sure that it's possible. I think it had something to do with intercepting functionality in a core Angular service through some form of delegation. – Sharky Nov 05 '15 at 19:44
  • I believe I also had to remove $location – jaypeagi May 18 '16 at 16:09