How does Angular understand which template view to request containing the 'ng-view' element?
If I directly navigate within my application to
http://localhost/Categories/List/accessories
, a request is still sent to '/' or the index template because it includes the necessary 'ng-view' element for rendering all views.
Switching from the index to /Categories/List/accessories does not trigger another request for the index template.
Below is a snippet of my basic routing configuration, partially taken from the "CookBook" example on GitHub:
angular.module('myApp', ['myApp.ctrl.list'])
.config(['$routeProvider', '$locationProvider', function ($routeProvider) {
$routeProvider.when('/', {
templateUrl: '/Home/Splash',
});
$routeProvider.when('/Categories/List/:slug', {
templateUrl: '/Categories/List',
controller: 'listCtrl',
});
$routeProvider.otherwise({
redirectTo: '/'
});
}]);