Skip to content

addModuleImportToRootModule does not work with module initialization #7

@lexon0011

Description

@lexon0011

I use the the function addModuleImportToRootModule in the following way:

addModuleImportToRootModule(
   host,
   `MyModule.forRoot(
     {
       option1: '<value of option1>',
       option2: '<value of option2>',
     })`,
   '@mycompany/my-module',
   project
);

As result, I get an invalid import statement in my app.module.ts. The module will be added correctly to the NgModule, but create an invalid import statement:

import { MyModule.forRoot(
   {
       option1: '<value of option1>',
       option2: '<value of option2>',
   }) } from '@mycompany/my-module';

Is there a way to to solve this problem?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions