About base href and angular-route

About angular-route

When using angular-route, I found a problem. The configuration items are all written correctly, but no matter how I click, it shows 404 not found, and there is no solution for a while.

As shown in the figure:

 
 
. when ( "/" , {
templateUrl : "../template/1.html"
})
. when ( "/addLeader" , {
templateUrl : "../template/addLeader.html"
})
1.html can be obtained;

click

<a href= "#/addLeader" > Add a leader account </a>

The following cannot be obtained, and 404  not found appears;


At the beginning, it was suspected that the " #/ " automatically added to the address bar caused the problem.


It was later discovered that this was not the case.

Mouse over the link to display

Then I manually changed the address bar to

It was found that the content in addLeader.html was read at this time.

Thinking that the base href has been set, I guess that the url cannot be obtained correctly due to the influence of this; after commenting it out, everything is normal.






Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325488223&siteId=291194637