How to use the @ngneat/transloco.getPipeValue function in @ngneat/transloco

To help you get started, we’ve selected a few @ngneat/transloco 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 ngneat / transloco / projects / ngneat / transloco-preload-langs / src / lib / transloco-preload-langs.module.ts View on Github external
const preloads = langs.map(currentLang => {
        const [isScoped, scopedPath] = getPipeValue(currentLang, 'scoped');
        const lang = isScoped ? `${scopedPath}/${service.getActiveLang()}` : currentLang;
        return service.load(lang).pipe(
          tap(() => {
            if (service.config.prodMode === false) {
              console.log(`%c 👁 Preloaded ${lang}`, 'background: #fff; color: #607D8B;');
            }
          })
        );
      });
      this.subscription = forkJoin(preloads).subscribe();