0

I am relative new to angular and tried to create a new webapp with a yeoman generator. All good but then I try to add a new route,

angular
.module('App', [
    'ngRoute'
])
.config(function ($routeProvider) {
    $routeProvider
        .when('/reset', {
            templateUrl: 'views/test.html',
            controller: 'TestCtrl',
            controllerAs: 'test'
        })
});

However when I try to access the route like:

http://localhost:8081/#/reset

It keeps getting replaced with:

http://localhost:8081/#!#%2Freset
luca.p.alexandru
  • 1,660
  • 5
  • 23
  • 42

1 Answers1

1

Take a look at this answer and see if it solves your problem. It looks like you may need to add $locationProvider.hashPrefix(''); to the route config.

Community
  • 1
  • 1
Jukebox
  • 1,603
  • 1
  • 16
  • 27