Colleagues,
I have the following scenario, I am building a website of type SPA
( Single Page Application ), so I need to work with $routeProvider
to link the routes to each view. So far so good, dynamic routes work well for me; the problem appears that despite doing what I need, the Chrome console detects an error of type
Uncaught Error: Syntax error, unrecognized expression: # / home.
Researching tried different ways to avoid this ( removing the slash, remove the hashtag, etc ) without any result.
This error also affects me in that I am initially loading a slider with owl-carousel
, but when I change the page and return to the initial slider, it does not show me the images = /
I'm attaching the HTML code
<nav id="nav-menu-container">
<ul class="nav-menu">
<li class="menu-active"><a href="#/home">Home</a></li>
<li><a href="#/places">About Us</a></li>
</ul>
</nav>
and the JS
app.config(['$routeProvider', '$locationProvider',
function ($routeProvider, $locationProvider) {
//$locationProvider.html5Mode(true);
$locationProvider.hashPrefix('');
$routeProvider
.when('/', { templateUrl: 'Pages/paraphrasing.html', controller: 'indexController' })
.when('/home', { templateUrl: 'Pages/paraphrasing.html', controller: 'indexController' })
.when('/places', { templateUrl: 'Pages/Norte/iregion.html', controller: 'northZoneController' })
}]);
Any suggestions you can give me to correct this? It would be appreciated