11import application = require( "application" ) ;
22import { LocationStrategy } from '@angular/common' ;
33import { NgZone , ApplicationRef , Inject , forwardRef } from '@angular/core' ;
4- import { log } from "./common " ;
4+ import { routerLog } from "../trace " ;
55import { topmost } from "ui/frame" ;
66
77interface LocationState {
@@ -20,18 +20,18 @@ export class NSLocationStrategy extends LocationStrategy {
2020 private _isPageNavigatingForward : boolean = false ;
2121
2222 path ( ) : string {
23- log ( "NSLocationStrategy.path()" ) ;
23+ routerLog ( "NSLocationStrategy.path()" ) ;
2424 let state = this . peekState ( ) ;
2525 return state ? state . url : "/" ;
2626 }
2727
2828 prepareExternalUrl ( internal : string ) : string {
29- log ( "NSLocationStrategy.prepareExternalUrl() internal: " + internal ) ;
29+ routerLog ( "NSLocationStrategy.prepareExternalUrl() internal: " + internal ) ;
3030 return internal ;
3131 }
3232
3333 pushState ( state : any , title : string , url : string , queryParams : string ) : void {
34- log ( `NSLocationStrategy.pushState state: ${ state } , title: ${ title } , url: ${ url } , queryParams: ${ queryParams } ` ) ;
34+ routerLog ( `NSLocationStrategy.pushState state: ${ state } , title: ${ title } , url: ${ url } , queryParams: ${ queryParams } ` ) ;
3535
3636 let isNewPage = this . _isPageNavigatingForward ;
3737 this . _isPageNavigatingForward = false ;
@@ -46,12 +46,12 @@ export class NSLocationStrategy extends LocationStrategy {
4646 }
4747
4848 replaceState ( state : any , title : string , url : string , queryParams : string ) : void {
49- log ( `NSLocationStrategy.replaceState state: ${ state } , title: ${ title } , url: ${ url } , queryParams: ${ queryParams } ` ) ;
49+ routerLog ( `NSLocationStrategy.replaceState state: ${ state } , title: ${ title } , url: ${ url } , queryParams: ${ queryParams } ` ) ;
5050 throw new Error ( "Not implemented" ) ;
5151 }
5252
5353 forward ( ) : void {
54- log ( "NSLocationStrategy.forward" ) ;
54+ routerLog ( "NSLocationStrategy.forward" ) ;
5555 throw new Error ( "Not implemented" ) ;
5656 }
5757
@@ -65,30 +65,30 @@ export class NSLocationStrategy extends LocationStrategy {
6565 state = this . states . pop ( ) ;
6666 count ++ ;
6767 }
68- log ( "NSLocationStrategy.back() while navigating back. States popped: " + count )
68+ routerLog ( "NSLocationStrategy.back() while navigating back. States popped: " + count )
6969 this . callPopState ( state , true ) ;
7070 } else {
7171 let state = this . peekState ( ) ;
7272 if ( state . isPageNavigation ) {
7373 // This was a page navigation - so navigate through frame.
74- log ( "NSLocationStrategy.back() while not navigating back but top state is page - will call frame.goback()" )
74+ routerLog ( "NSLocationStrategy.back() while not navigating back but top state is page - will call frame.goback()" )
7575 topmost ( ) . goBack ( ) ;
7676 } else {
7777 // Nested navigation - just pop the state
78- log ( "NSLocationStrategy.back() while not navigating back but top state is not page - just pop" )
78+ routerLog ( "NSLocationStrategy.back() while not navigating back but top state is not page - just pop" )
7979 this . callPopState ( this . states . pop ( ) , true ) ;
8080 }
8181 }
8282
8383 }
8484
8585 onPopState ( fn : ( _ : any ) => any ) : void {
86- log ( "NSLocationStrategy.onPopState" ) ;
86+ routerLog ( "NSLocationStrategy.onPopState" ) ;
8787 this . popStateCallbacks . push ( fn ) ;
8888 }
8989
9090 getBaseHref ( ) : string {
91- log ( "NSLocationStrategy.getBaseHref()" ) ;
91+ routerLog ( "NSLocationStrategy.getBaseHref()" ) ;
9292 return "" ;
9393 }
9494
@@ -108,15 +108,15 @@ export class NSLocationStrategy extends LocationStrategy {
108108
109109 // Methods for syncing with page navigation in PageRouterOutlet
110110 public beginBackPageNavigation ( ) {
111- log ( "NSLocationStrategy.startGoBack()" ) ;
111+ routerLog ( "NSLocationStrategy.startGoBack()" ) ;
112112 if ( this . _isPageNavigationgBack ) {
113113 throw new Error ( "Calling startGoBack while going back." )
114114 }
115115 this . _isPageNavigationgBack = true ;
116116 }
117117
118118 public finishBackPageNavigation ( ) {
119- log ( "NSLocationStrategy.finishBackPageNavigation()" ) ;
119+ routerLog ( "NSLocationStrategy.finishBackPageNavigation()" ) ;
120120 if ( ! this . _isPageNavigationgBack ) {
121121 throw new Error ( "Calling endGoBack while not going back." )
122122 }
@@ -128,7 +128,7 @@ export class NSLocationStrategy extends LocationStrategy {
128128 }
129129
130130 public navigateToNewPage ( ) {
131- log ( "NSLocationStrategy.navigateToNewPage()" ) ;
131+ routerLog ( "NSLocationStrategy.navigateToNewPage()" ) ;
132132 if ( this . _isPageNavigatingForward ) {
133133 throw new Error ( "Calling navigateToNewPage while already navigating to new page." )
134134 }
0 commit comments