angularjsnode.jsmongodbelasticsearchmeanjs

How to Remove # tag from url MEAN STACK


Hi i am using Mean stack for a Web application problem is the url containing #!

something like

 http://host:3000/#!/signup 

I want the urls like

  http://host:3000/signup 

How to do this.


Solution

  • In your $routeProvider, use the HTML5 History API:

    $locationProvider.html5Mode(true);

    Setting For Relative Links:

    To link around your application using relative links, you will need to set a <base> in the <head> of your document.

    <!doctype html>
    <html>
    <head>
        <meta charset="utf-8">
    
        <base href="/">
    </head>
    

    You can read about this in detail here: Pretty URLs in AngularJS: Removing the #

    Hope this helps.