I'm having an issue with using the templateUrl in a directive to load a partial. Whenever I try to visit the URL for the template, it redirects me back to /. This results in the partial loading the entire page instead of just the requested partial.
add-to-cart.js
.directive('addToCart', function() {
return {
restrict: 'E',
scope: {
},
replace: false,
templateUrl: 'src/common/add-to-cart/add-to-cart.tpl.html',
link: function(scope, element, attrs) {
}
};
});
app.js
$urlRouterProvider.otherwise( '/' );
Can anyone explain why this is happening and provide a solution?