Home >Web Front-end >JS Tutorial >AngularJS routing delete #symbol example sharing

AngularJS routing delete #symbol example sharing

小云云
小云云Original
2018-01-30 09:53:211430browse

This article mainly introduces the relevant information on how to delete the # symbol in AngularJS routing. I hope this article can help everyone. Friends in need can refer to it. I hope it can help everyone.

AngularJS routing solution to delete the # symbol

I recently made a web application, and there was a need to delete the # symbol in the angular routing.

For example:


http://example.com/
http://example.com/#/about
http://example.com/#/contact

needs to be changed to


http://example.com/
http://example.com/about
http://example.com/contact

This is provided by angular by default , so if you want to delete it, you need to configure it:


$locationProvider.html5Mode(true);

Then in the header of index.html, specify a base:


<base href="/" rel="external nofollow" >

This is ok. If necessary, inform yourself to try it!

Related recommendations:

AngularJS imitation WeChat picture gesture scaling code

AngularJS uses ui-route to achieve multi-layer nesting Routing

AngularJs user login problem handling

The above is the detailed content of AngularJS routing delete #symbol example sharing. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn