How to use the download/info.json function in download

To help you get started, we’ve selected a few download examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github usgs / earthquake-eventpages / src / app / core / metadata.service.ts View on Github external
getMetadata(product: any): void {
    if (product === null || !product.contents['download/info.json']) {
      this.onMetadata(null);
      return;
    }

    const metadata = product.contents['download/info.json'];

    this.httpClient
      .get(metadata.url)
      .pipe(catchError(this.handleError()))
      .subscribe((data: any) => {
        try {
          this.onMetadata(data);
        } catch (e) {
          /* Processing error */
          this.error = e;
          this.metadata$.next(null);
        }
      });
  }
github usgs / earthquake-eventpages / src / app / core / metadata.service.ts View on Github external
getMetadata(product: any): void {
    if (product === null || !product.contents['download/info.json']) {
      this.onMetadata(null);
      return;
    }

    const metadata = product.contents['download/info.json'];

    this.httpClient
      .get(metadata.url)
      .pipe(catchError(this.handleError()))
      .subscribe((data: any) => {
        try {
          this.onMetadata(data);
        } catch (e) {
          /* Processing error */
          this.error = e;
          this.metadata$.next(null);