File tree Expand file tree Collapse file tree 4 files changed +21
-20
lines changed
Expand file tree Collapse file tree 4 files changed +21
-20
lines changed Original file line number Diff line number Diff line change 11/** @module common */ /** for typedoc */
22/// <reference path='../../typings/angularjs/angular.d.ts' />
33import { IQService } from "angular" ;
4+ import { Router } from "../router" ;
45
56let app = angular . module ( "ui.router.angular1" , [ ] ) ;
67
@@ -58,3 +59,12 @@ function runBlock($injector) {
5859}
5960
6061app . run ( runBlock ) ;
62+
63+
64+ let router = new Router ( ) ;
65+
66+ // Register as a provider so it's available to other providers
67+ angular . module ( 'ui.router.util' ) . provider ( '$urlMatcherFactory' , ( ) => router . urlMatcherFactory ) ;
68+ angular . module ( 'ui.router.util' ) . run ( [ '$urlMatcherFactory' , function ( $urlMatcherFactory ) { } ] ) ;
69+
70+ export { router } ;
Original file line number Diff line number Diff line change 1- export class UIRouter {
1+ import { UrlMatcherFactory } from "./url/urlMatcherFactory" ;
22
3- }
3+ class Router {
4+ constructor ( ) { }
5+ urlMatcherFactory : UrlMatcherFactory = new UrlMatcherFactory ( ) ;
6+ }
7+
8+ export { Router } ;
Original file line number Diff line number Diff line change @@ -7,27 +7,17 @@ class MatcherConfig {
77 _defaultSquashPolicy : ( boolean | string ) = false ;
88
99 caseInsensitive ( value ?: boolean ) : boolean {
10- if ( ! isDefined ( value ) )
11- return this . _isCaseInsensitive ;
12-
13- return this . _isCaseInsensitive = value ;
10+ return this . _isCaseInsensitive = isDefined ( value ) ? value : this . _isCaseInsensitive ;
1411 }
1512
1613 strictMode ( value ?: boolean ) : boolean {
17- if ( ! isDefined ( value ) )
18- return this . _isStrictMode ;
19-
20- return this . _isStrictMode = value ;
14+ return this . _isStrictMode = isDefined ( value ) ? value : this . _isStrictMode ;
2115 }
2216
2317 defaultSquashPolicy ( value ?: ( boolean | string ) ) : ( boolean | string ) {
24- if ( ! isDefined ( value ) )
25- return this . _defaultSquashPolicy ;
26-
27- if ( value !== true && value !== false && ! isString ( value ) )
18+ if ( isDefined ( value ) && value !== true && value !== false && ! isString ( value ) )
2819 throw new Error ( `Invalid squash policy: ${ value } . Valid policies: false, true, arbitrary-string` ) ;
29-
30- return this . _defaultSquashPolicy = value ;
20+ return this . _defaultSquashPolicy = isDefined ( value ) ? value : this . _defaultSquashPolicy ;
3121 }
3222}
3323
Original file line number Diff line number Diff line change @@ -151,7 +151,3 @@ export class UrlMatcherFactory {
151151 return this ;
152152 } ;
153153}
154-
155- // Register as a provider so it's available to other providers
156- angular . module ( 'ui.router.util' ) . provider ( '$urlMatcherFactory' , < any > UrlMatcherFactory ) ;
157- angular . module ( 'ui.router.util' ) . run ( [ '$urlMatcherFactory' , function ( $urlMatcherFactory ) { } ] ) ;
You can’t perform that action at this time.
0 commit comments