Skip to content

Commit b7b5e4f

Browse files
feat(UIRouterModule): Add initial property to forRoot to specify the initial route.
1 parent 6419fdf commit b7b5e4f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/uiRouterConfig.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export function applyModuleConfig(uiRouter: UIRouter, injector: Injector, module
1616
export function applyRootModuleConfig(uiRouter: UIRouter, injector: Injector, module: RootModule) {
1717
isDefined(module.deferIntercept) && uiRouter.urlService.deferIntercept(module.deferIntercept);
1818
isDefined(module.otherwise) && uiRouter.urlService.rules.otherwise(module.otherwise);
19+
isDefined(module.initial) && uiRouter.urlService.rules.initial(module.initial);
1920
}
2021

2122

src/uiRouterNgModule.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,20 @@ export interface RootModule extends StatesModule {
179179
useHash?: boolean;
180180

181181
/**
182-
* Sets [[UrlRouterProvider.otherwise]].
182+
* Configures the `otherwise` rule, which chooses the state or URL to activate when no other routes matched.
183+
*
184+
* See: [[UrlRulesApi.otherwise]].
183185
*/
184186
otherwise?: (string | UrlRuleHandlerFn | TargetState | TargetStateDef);
185187

188+
/**
189+
* Configures the `initial` rule, which chooses the state or URL to activate when the
190+
* application initially starts, and no other routes matched.
191+
*
192+
* See: [[UrlRulesApi.initial]].
193+
*/
194+
initial?: (string | UrlRuleHandlerFn | TargetState | TargetStateDef);
195+
186196
/**
187197
* Sets [[UrlRouterProvider.deferIntercept]]
188198
*/

0 commit comments

Comments
 (0)