We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
HashLocationStrategy
1 parent 546a8f9 commit d6dadc6Copy full SHA for d6dadc6
modules/angular2/src/router/hash_location_strategy.ts
@@ -23,7 +23,12 @@ export class HashLocationStrategy extends LocationStrategy {
23
path(): string {
24
// the hash value is always prefixed with a `#`
25
// and if it is empty then it will stay empty
26
- return this._location.hash.substring(1);
+ var path = this._location.hash;
27
+
28
+ // Dart will complain if a call to substring is
29
+ // executed with a position value that extends the
30
+ // length of string.
31
+ return path.length > 0 ? path.substring(1) : path;
32
}
33
34
pushState(state: any, title: string, url: string) {
0 commit comments