Hello! I have a problem with ngRoute that I can not understand why.
Basically, when I try to access a specific URL from a route, from outside the app (not from an application link), I get the message Can not GET / Route .
My route definition is as follows:
$routeProvider
.when('/', {
templateUrl: '/app/views/home.view.html',
controller: 'MainController'
})
.when('/rota', {
templateUrl: '/app/views/rota.view.html',
controller: 'RotaController'
})
.otherwise({
redirectTo: '/'
});
$locationProvider.html5Mode(true);
When access link , it should render the view 'route.view.html', but I get the error Can not GET / route on the screen and this error in the console:
Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, the hash ('sha256-hzYGow + v / BzJilvlDniVqfrdxCAYE9ApuYT6MnI40fQ ='), or a nonce ('nonce -...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
If I access this route from within the application (via a navbar link, for example), I need to put / # / route to work. The idea of html5Mode would be to get this # from the route, but it is not possible because it gives error without it.