Routing issue with AngularJS project using yoman setting

I installed a new Angular project using yoman. The Angular version is 1.6.0. The project setup was successful, but I ran into a routing problem

Task runner - Grunt

When I run the project locally, my local page will load with the URL

http: // localhost: 9000 / #! /

I was expecting http: // localhost: 9000 / # /

When you click on the link About the browser links are routed to

http: // localhost: 9000 / #! /% 23% 2Fabout

Waiting: http: // localhost: 9000 / # / about

When I click the link to the home page, the browser is routed to

http: // localhost: 9000 / #! /% 23% 2F

Waiting: http: // localhost: 9000 / # /

What could be the problem? I have no such problems on my other system where I use AngularJS 1.5.8.

+2
source share
1 answer

I got the solution using the following code. You can write in the app.js file

$locationProvider.hashPrefix(''); 
+6
source

Source: https://habr.com/ru/post/1262285/


All Articles