Hi,
I am having this strange issue with when html5mode is turned on.
Background: I am running NodeJS Express for the backend, but having AngularJS do the routing on the app. (Express handles my API routes)
so I capture everything and just render the index.html and let angular do it's thing:
app.get('*', function(req, res) {
res.sendfile('./public/index.html');
});
My angularJS routes look something like:
angular.module("app-name", ['services', 'ngResource'])
.config(function($routeProvider, $locationProvider) {
$routeProvider.when('/', {
templateUrl: 'views/homeview.html',
controller: 'homeCtrl'
});
$routeProvider.when('/login', {
templateUrl: 'views/loginView.html',
controller: 'loginCtrl'
});
$routeProvider.when('/register', {
templateUrl: 'views/registerView.html',
controller: 'registerCtrl'
});
$routeProvider.otherwise({
redirectTo: '/'
});
This works perfectly. I can access the login and register pages just fine, if i type in a route that doesn't exist like "/kdsaj" it just redirects to "/".
The issue I am having is when trying to capture params or deep-linking.
So if i have a route that's '/about/contact' or '/users/:userId' angular crashes each time. The only error I get is: Uncaught SyntaxError: Unexpected token <
Has anyone experienced this problem before or knows any remedies?
Thanks,
Ado