How to use the @ngneat/transloco.flatten 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-messageformat / src / lib / messageformat.transpiler.spec.ts View on Github external
it('should translate simple string multiple keys from lang', () => {
    const lang = flatten({
      withKeys: 'with keys',
      from: 'from',
      lang: 'lang',
      nes: { ted: 'supporting nested values!' }
    });
    const parsed = parser.transpile('Hello {{ withKeys }} {{ from }} {{ lang }} {{nes.ted}}', {}, lang);
    expect(parsed).toEqual('Hello with keys from lang supporting nested values!');
  });