1

Change the below url

http://example.com/#/alphabits/a b c

to

http://example.com/#!/alphabits/a_b_c

Any suggestion

1

1 Answer 1

2

You can change this from $locationProvider. I used this code in my application to change this.

angular.module('myApp').config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$locationProvider.hashPrefix(''); // We are actually removing ! from URLs as ! is default one.
$routeProvider
    .when('/', {
        templateUrl: 'templates/home.tpl.html',
        controller: 'homeCtrl'
    })
    .when('/about', {
        templateUrl: 'templates/about.tpl.html',
        controller: 'aboutCtrl'
    })
    .otherwise({
        redirectTo: '/'
    });

  }]);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.