2

With Angular 14 and standalone components, the app.module.ts can go away and instead something like this goes in main.ts instead:

bootstrapApplication(AppComponent, {
  providers: [
    importProvidersFrom(HttpClientModule)
  ]
})

I'm trying to figure out how to modify that from a schematic so that I can add new modules, and specifically add modules with properties. I'm wanting to end up with this:

bootstrapApplication(AppComponent, {
  providers: [
    importProvidersFrom(
      HttpClientModule, BrowserAnimationsModule,
      EmployeeLookupModule.forRoot({
        url: 'https://www.example.com/employee'
      })
    )
  ]
})

Are there new methods defined somewhere that handle this?

2
  • Did you ever find a solution for this? With NgModules, I was able to use the ast-utils from @schematics/angular. Looking for something similar. Commented Sep 26, 2023 at 21:26
  • No, I just gave up. Commented Sep 26, 2023 at 22:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.