Let\'s say I have the following 3 Angular UI Router states:
$stateProvider
.state(\'adminCompanies\', {
abstract: true,
url: \"/admin/com
In version 1.0.0alpha0 they finally make it possible! Not child for abstract states, new $transitionsProvider, in which you could define onBefore hook. You can change the behaviour depends on state options.
For example you can change "abstract" param behaviour:
$transitionsProvider.onBefore({
to: state => !!state.abstract
}, ($transition$, $state) => {
if (angular.isString($transition.to().abstract)) {
return $state.target($transition.to().abstract);
}
});
and use it like so:
abstract: 'abstract2.foo', //use not boolean but exact child state
code example
was taken from: ui-router: Default child for abstract state