How to get '#' from Angular URLs

0

My app's URL is like this ' link '. I'm trying to get the '#' from the URL, I've tried it in many ways but I can not. I have the following code.

config.js:

function config($stateProvider, $urlRouterProvider, $locationProvider, $ocLazyLoadProvider, IdleProvider, KeepaliveProvider) {

// Configure Idle settings
IdleProvider.idle(5); // in seconds
IdleProvider.timeout(120); // in seconds

$urlRouterProvider.otherwise("/login");
// $locationProvider.hashPrefix('');

$ocLazyLoadProvider.config(['$locationProvider', function($locationProvider) {
  $locationProvider.html5Mode(true);
    // Set to true if you want to see what and when is dynamically loaded
    debug: false
}]);

index.html:

<head>
   ...
   <base href="/">
</head> 
    
asked by anonymous 06.04.2018 / 15:01

1 answer

1

This is not possible because the "#" character is part of the Angular routing mechanics.

To "remove" this character, you have to take the routing to the server side, either by using a framework (recommended) or something more "handcrafted" by creating folders on the server.

    
06.04.2018 / 16:11