Angularjs and routes with #!

0

I have a website with angularjs 1.6.4 and when I joined link I automatically added #! and enter

http://www.misitio.com/mercado/index.html#!/

At first I was annoyed and I did the whole site without problems, with entityframework and web api. The problem occurs when wanting to share in the front links of the style link This link works if I copy it and paste it in the browser, it brings me the product with Id 44, the problem is to share this link in facebook, whatsapp etc, I am crazy and only shares

http://www.misitio.com/mercado/web

I already tried the following to remove the #!

$locationProvider.html5Mode(true);

and also with javascript with an encode

Nothing works for me, does anyone know what I can do? thanks

    
asked by Lucho 31.05.2018 в 17:50
source

1 answer

0

To solve your problem try the following:

1- Add this within the <head> tag

<base href="/" /> 

2- Use this in app.config

$locationProvider.html5Mode(true);
    
answered by 02.06.2018 в 15:42