Angularjs for a period of time, should the project needs, to remove the URL of those #, search the online method is very simple
Http://developer.51cto.com/art/201406/443898.htm
It is easy to get a clean URL and to remove the pound sign from the URL.
Do two things on the line.
configuration $locationProvider
Set the start path of our relative connection
Monitorapp.config ([' $stateProvider ', ' $urlRouterProvider ', ' $locationProvider ', function ($stateProvider, $ Urlrouterprovider, $locationProvider) { $urlRouterProvider. Otherwise ('/main/service '); $stateProvider . State (' main ', { URL: '/main/:type ', templateurl: ' pages/main.html ', controller: ' Maincontroller ' }) . State (' monitor ', { URL: '/monitor/:template ', templateurl: ' pages/ Monitor.html ', controller: ' Monitorcontroller ' ) $locationProvider. Html5mode (True); }])
In order to use relative links throughout the application, you will need to set a <set> in the
- < Span style= "margin:0px; padding:0px; Border:none; Background-color:inherit "><!doctype html > &NBSP;
- < html > &NBSP;
- < Head >
- <Meta CharSet="Utf-8">
- <Base href="/">
- </ Head >
two issues encountered during the setup process
1. When the base href is not configured on the home page, access to/main/service cannot be controlled by Maincontroller.
2. After the configuration is complete, all the a tags on the page are set to href= #的链接都会往默认的首页跳转, because I configured the
<span style= "FONT-SIZE:18PX;" > $urlRouterProvider. Otherwise ('/main/service ');</span>
<span style= "FONT-SIZE:18PX;" > in order to solve this problem, I have just started to remove the attributes of href=#, and then think of such a click when the mouse gesture is not quite right, although can be resolved with CSS, but the limit is too dead </span>
<span style= "FONT-SIZE:18PX;" > later accidentally changed the version of Angularjs solved the problem, the original issue of the version is v1.2.5, replaced by 1.3.9</span>
Friendly URLs in Angularjs: Remove the pits that are encountered in the URL