MCPcopy
hub / github.com/angular-ui/ui-router / when

Method when

src/urlRouterProvider.ts:167–174  ·  view source on GitHub ↗

* Registers a handler for a given url matching. * * If the handler is a string, it is * treated as a redirect, and is interpolated according to the syntax of match * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise). * * If the handler is a funct

(what: RegExp | UrlMatcher | string, handler: string | IInjectable)

Source from the content-addressed store, hash-verified

165 * Note: the handler may also invoke arbitrary code, such as `$state.go()`
166 */
167 when(what: RegExp | UrlMatcher | string, handler: string | IInjectable): this {
168 if (isArray(handler) || isFunction(handler)) {
169 handler = UrlRouterProvider.injectableHandler(this.router, handler);
170 }
171
172 this.router.urlService.rules.when(what, handler as any);
173 return this;
174 }
175
176 /**
177 * Disables monitoring of the URL.

Callers 14

urlRouterSpec.tsFile · 0.80
$httpFunction · 0.80
createHttpBackendMockFunction · 0.80
$HttpProviderFunction · 0.80
$httpFunction · 0.80
$httpFunction · 0.80
createHttpBackendMockFunction · 0.80
$httpFunction · 0.80
createHttpBackendMockFunction · 0.80
asTemplateMethod · 0.80
asComponentMethod · 0.80

Calls 3

isArrayFunction · 0.85
injectableHandlerMethod · 0.80
isFunctionFunction · 0.50

Tested by

no test coverage detected