How to use the @ngrx/data/schematics-core.addImportToModule function in @ngrx/data

To help you get started, we’ve selected a few @ngrx/data 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 ngrx / platform / modules / data / schematics / ng-add / index.ts View on Github external
ts.ScriptTarget.Latest,
      true
    );

    const moduleToImport = options.effects
      ? 'EntityDataModule'
      : 'EntityDataModuleWithoutEffects';

    const effectsModuleImport = insertImport(
      source,
      modulePath,
      moduleToImport,
      '@ngrx/data'
    );

    const [dateEntityNgModuleImport] = addImportToModule(
      source,
      modulePath,
      options.entityConfig
        ? [moduleToImport, 'forRoot(entityConfig)'].join('.')
        : moduleToImport,
      ''
    );

    const changes = [effectsModuleImport, dateEntityNgModuleImport];

    if (options.entityConfig) {
      const entityConfigImport = insertImport(
        source,
        modulePath,
        'entityConfig',
        './entity-metadata'