My routes look like:
$stateProvider.state('repository', {
url: '/:host/:owner/:repository',
views: {
appView: {
templateUrl: '/templates/app/repository.html'
}
}
}).state('repository.analytics', {
views: {
repositoryView: {
templateUrl: '/templates/app/_repositoryAnalytics.html'
}
}
}).state('repository.commit', {
url: '/:host/:owner/:repository/commit/:commitHash',
views: {
repositoryView: {
templateUrl: '/templates/app/_repositoryCommit.html'
}
}
}).state('repository.file', {
url: '/file?path',
views: {
repositoryView: {
templateUrl: '/templates/app/_repositoryFile.html'
}
}
});
I want the base URL for all repository
-like states, that's why I'm specifying the url
there. As an example, if I didn't do it this way, I would have to specify everything as it's shown in the commit
state. This is verbose and not something I want to do.
So is it possible to have a default
child state for repository
so that if someone is directed there, then that child view loads?
** UPDATE **
This seems to work just fine if I click through the app, but if I go to the /:host/:owner/:repository
URL directly, the child view (analytics) never loads.