Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable routing in angularjs?

Tags:

angularjs

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.

like image 982
chris Avatar asked Apr 03 '13 06:04

chris


People also ask

How would I restrict access to routes in angular?

Include AuthGuard to Route Now for each request of the route, the verify() function will be called and if the verify() function returns true, then only we can access the particular route. If it returns false, we are not able to access it. This is how we can restrict the routes from unauthorized user access.

What is routing AngularJS?

Routing in AngularJS is used when the user wants to navigate to different pages in an application but still wants it to be a single page application. AngularJS routes enable the user to create different URLs for different content in an application.

How does AngularJS application route?

Application routes in AngularJS are declared via the $routeProvider, which is the provider of the $route service. This service makes it easy to wire together controllers, view templates, and the current URL location in the browser.


1 Answers

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

like image 98
John Woodruff Avatar answered Oct 14 '22 10:10

John Woodruff