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

AngularJS routing delete #symbol example sharing

小云云
Release: 2018-01-30 09:53:21
Original
1426 people have browsed it

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
Copy after login

needs to be changed to


http://example.com/
http://example.com/about
http://example.com/contact
Copy after login

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


$locationProvider.html5Mode(true);
Copy after login

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


<base href="/" rel="external nofollow" >
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template