Jun 26, 2016

How to remove hashtag in ngRoute and ui-router

You need to enable HTML5Mode if you want navigation without hash tags:

app.config(function($locationProvider) {
  $locationProvider.html5Mode({
      enabled: true,
      requireBase: false
  });
});
If you configure $location to use html5Mode (history.pushState), you need to specify the base URL for the application with a tag or configure $locationProvider to not require a base tag by passing a definition object with requireBase:false to $locationProvider.html5Mode():

No comments:

Post a Comment