* Defines the path or behavior to use when no url can be matched. * * #### Example: * ```js * var app = angular.module('app', ['ui.router.router']); * * app.config(function ($urlRouterProvider) { * // if the path doesn't match any of the urls you configured * // otherwise
(rule: string | RawNg1RuleFunction)
| 114 | * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance |
| 115 | */ |
| 116 | otherwise(rule: string | RawNg1RuleFunction): UrlRouterProvider { |
| 117 | const urlRules = this.router.urlService.rules; |
| 118 | if (isString(rule)) { |
| 119 | urlRules.otherwise(rule); |
| 120 | } else if (isFunction(rule)) { |
| 121 | urlRules.otherwise(() => rule(services.$injector, this.router.locationService)); |
| 122 | } else { |
| 123 | throw new Error("'rule' must be a string or function"); |
| 124 | } |
| 125 | |
| 126 | return this; |
| 127 | } |
| 128 | |
| 129 | /** |
| 130 | * Registers a handler for a given url matching. |
no test coverage detected