File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import {XHR} from "@angular/compiler/src/xhr";
4
4
export class FileSystemXHR extends XHR {
5
5
resolve ( url : string , baseUrl : string ) : string {
6
6
//Angular assembles absolute URL's and prefixes them with //
7
- if ( url . indexOf ( "// " ) !== 0 ) {
7
+ if ( url . indexOf ( "/" ) !== 0 ) {
8
8
//Resolve relative URL's based on the app root.
9
9
return path . join ( baseUrl , url ) ;
10
10
} else {
Original file line number Diff line number Diff line change @@ -8,8 +8,13 @@ describe("XHR name resolution", () => {
8
8
assert . strictEqual ( "/app/dir/mydir/mycomponent.html" , xhr . resolve ( "mydir/mycomponent.html" , "/app/dir" ) )
9
9
} ) ;
10
10
11
- it ( "resolves absolute paths as is" , ( ) => {
11
+ it ( "resolves double-slashed absolute paths as is" , ( ) => {
12
12
const xhr = new FileSystemXHR ( ) ;
13
13
assert . strictEqual ( "//app/mydir/mycomponent.html" , xhr . resolve ( "//app/mydir/mycomponent.html" , "/app/dir" ) )
14
14
} ) ;
15
+
16
+ it ( "resolves single-slashed absolute paths as is" , ( ) => {
17
+ const xhr = new FileSystemXHR ( ) ;
18
+ assert . strictEqual ( "/data/data/app/mydir/mycomponent.html" , xhr . resolve ( "/data/data/app/mydir/mycomponent.html" , "/app/dir" ) )
19
+ } ) ;
15
20
} )
You can’t perform that action at this time.
0 commit comments