@@ -7,9 +7,12 @@ import { LocationServices } from "../common/coreservices";
7
7
import { Disposable } from "../interface" ;
8
8
import { UIRouter } from "../router" ;
9
9
import { LocationLike , HistoryLike } from "./interface" ;
10
- import { parseUrl , getParams , buildUrl } from "./utils" ;
10
+ import { parseUrl , getParams , buildUrl , getCustomEventCtor } from "./utils" ;
11
11
import { isDefined } from "../common/predicates" ;
12
12
import { extend , deregAll , removeFrom } from "../common/common" ;
13
+
14
+ const Evt : typeof CustomEvent = getCustomEventCtor ( ) ;
15
+
13
16
/** A base `LocationServices` */
14
17
export abstract class BaseLocationServices implements LocationServices , Disposable {
15
18
constructor ( router : UIRouter , public fireAfterUpdate : boolean ) {
@@ -59,7 +62,7 @@ export abstract class BaseLocationServices implements LocationServices, Disposab
59
62
this . _set ( null , null , url , replace ) ;
60
63
61
64
if ( this . fireAfterUpdate ) {
62
- let evt = extend ( new Event ( "locationchange" ) , { url } ) ;
65
+ let evt = extend ( new Evt ( "locationchange" ) , { url } ) ;
63
66
this . _listeners . forEach ( cb => cb ( evt ) ) ;
64
67
}
65
68
}
0 commit comments