AngularJS: ui-router: how to get state parameter from child state? -
the question sounds bit stupid. let me explane i'm going achieve.
my simplified code:
$stateprovider .state('course', { url: '/courses/:courseid', controller: 'coursecontroller' }); $stateprovider .state('course.topic', { url: '/topics/:topicid', controller: 'topiccontroller' });
without topicid it's not possible show content, know on course level if topic not set - should set first topic course.
how ui-router?
basically need param child state.
what about
$stateprovider .state('course', { abstract: true, url: '/courses/:courseid', controller: 'coursecontroller' }) .state('course.topic', { url: '/topics/:topicid', controller: 'topiccontroller' }) .state('course.firsttopic', { url: '', controller: 'topiccontroller' });
Comments
Post a Comment