Reputation: 473
Im having problems using routeProvider to route to a subdirectory url. The Following Angular route works fine:
$routeProvider.when('/customerapi', {templateUrl: 'partials/customerApi.html', controller: 'customerApiController'});
but when I attempt to do the following:
$routeProvider.when('/projects/customerapi', {templateUrl: 'partials/customerApi.html', controller: 'customerApiController'});
everything breaks. I get the following error
I know it can find the partial, it finds it fine when the route is just /customerapi...
Im unsure why its trying to load projects/partials/customerApi.html instead of angular intercepting and loading the partial. The tag I am using to link to the partial looks like the following :
<a href="/projects/customerapi">Customer API</a>
Anyone happen to see my error?
Thanks so much!
Upvotes: 1
Views: 604
Reputation: 6674
Try specifying the absolute path of the partial (note the /
in front of templateUrl
):
$routeProvider.when('/projects/customerapi', {templateUrl: '/partials/customerApi.html', controller: 'customerApiController'});
Upvotes: 2