How to use the @igo2/utils.Clipboard.copy function in @igo2/utils

To help you get started, we’ve selected a few @igo2/utils 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 infra-geo-ouverte / igo2-lib / packages / geo / src / lib / routing / routing-form / routing-form.component.ts View on Github external
copyLinkToClipboard() {
    const successful = Clipboard.copy(this.getUrl());
    if (successful) {
      const translate = this.languageService.translate;
      const title = translate.instant('igo.geo.routingForm.dialog.copyTitle');
      const msg = translate.instant('igo.geo.routingForm.dialog.copyMsgLink');
      this.messageService.success(msg, title);
    }
  }
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / routing / routing-form / routing-form.component.ts View on Github external
: ' (' + this.formatDistance(step.distance) + ')';
      activeRouteDirective =
        activeRouteDirective +
        indent +
        (localCnt + 1).toLocaleString() +
        '. ' +
        instruction +
        distance +
        '\n';
      localCnt++;
    });

    const directionsBody =
      summary + wayPointList + '\n' + url + '\n\n' + activeRouteDirective;

    const successful = Clipboard.copy(directionsBody);
    if (successful) {
      const translate = this.languageService.translate;
      const title = translate.instant('igo.geo.routingForm.dialog.copyTitle');
      const msg = translate.instant('igo.geo.routingForm.dialog.copyMsg');
      this.messageService.success(msg, title);
    }
  }
github infra-geo-ouverte / igo2-lib / packages / context / src / lib / share-map / share-map / share-map.component.ts View on Github external
copyTextToClipboard(textArea) {
    const successful = Clipboard.copy(textArea);
    if (successful) {
      const translate = this.languageService.translate;
      const title = translate.instant(
        'igo.context.shareMap.dialog.copyTitle'
      );
      const msg = translate.instant('igo.context.shareMap.dialog.copyMsg');
      this.messageService.success(msg, title);
    }
  }