(error: Error)
| 248 | // a Javascript error. It emits the error via the Observable error channel as |
| 249 | // a HttpErrorResponse. |
| 250 | const onError = (error: Error) => { |
| 251 | cleanup(); |
| 252 | |
| 253 | // Wrap the error in a HttpErrorResponse. |
| 254 | observer.error( |
| 255 | new HttpErrorResponse({ |
| 256 | error, |
| 257 | status: 0, |
| 258 | statusText: 'JSONP Error', |
| 259 | url, |
| 260 | }), |
| 261 | ); |
| 262 | }; |
| 263 | |
| 264 | // Subscribe to both the success (load) and error events on the <script> tag, |
| 265 | // and add it to the page. |
no test coverage detected