(path: string, html5Mode = true)
| 143 | |
| 144 | // https://github.com/angular/angular.js/blob/864c7f0/src/ng/location.js#L27 |
| 145 | decodePath(path: string, html5Mode = true): string { |
| 146 | const segments = path.split('/'); |
| 147 | let i = segments.length; |
| 148 | |
| 149 | while (i--) { |
| 150 | segments[i] = decodeURIComponent(segments[i]); |
| 151 | if (html5Mode) { |
| 152 | // encode forward slashes to prevent them from being mistaken for path separators |
| 153 | segments[i] = segments[i].replace(/\//g, '%2F'); |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | return segments.join('/'); |
| 158 | } |
| 159 | |
| 160 | // https://github.com/angular/angular.js/blob/864c7f0/src/ng/location.js#L72 |
| 161 | decodeSearch(search: string) { |
no test coverage detected