Express + Angular routing causing infinite loop + crash
I'm work on a Node app using Express as well as Angular. I'm using Angular
for routing and have my routes setup like so:
app.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/', {
templateUrl: '/partials/main'
//controller: 'IndexController'
}).when('/discover', {
templateUrl: '/partials/discover'
}).when('/user/home', { //HERES THE PROBLEM CHILD!!!!!
templateUrl: '/partials/user/home'
}).otherwise({
redirectTo: '/'
});
}]).config(['$locationProvider', function ($locationProvider) {
$locationProvider.html5Mode(true);
}]);
Now, whenever I try and call /user/home -- The page goes into an infinite
loop and keeps reloading the controller. I can see in the node console
that the page was called from partials/user/home which definitely contains
a Jade file. I've checked other posts, most of them are solved with ass
the / in the beginning of the partials path, that didn't help here. The
page loads fine if I transfer home.jade into the /partials directory with
no sub directory. Any ideas?
No comments:
Post a Comment