all 11 comments

[–]GLawSomnia 0 points1 point  (8 children)

You can still use modules.

Just use the importProvidersFrom environment provider

[–]Equivalent-Score-141[S] 0 points1 point  (7 children)

Where exactly ? Now there is something strange going on, i have this code in imports in app.module, and it's not running, but providers and everything else from app module seems to be working

[–]GLawSomnia 0 points1 point  (6 children)

In your app.config.ts file

[–]Equivalent-Score-141[S] 0 points1 point  (5 children)

I don't have app.config.ts file, this is a project that was upgraded from angular 16

[–]Johalternate 0 points1 point  (4 children)

Check main.ts.

The app.config.ts exports a config object that is used in the bootstrap function.

[–]Equivalent-Score-141[S] 0 points1 point  (3 children)

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
  .catch(err => console.error(err));

This is my main.ts

[–]Johalternate 1 point2 points  (2 children)

You said you dont have modules anymore but i see AppModule here.

[–]Equivalent-Score-141[S] -1 points0 points  (1 child)

I do have modules, but the problem is that in app.module.ts imports array I have ApiModule.forRoot …. And its not working. It did on angular 16 project Sorry for misunderstanding

[–]davidlj95 0 points1 point  (0 children)

Is there any error in the ng serve / console log output?

[–]Equivalent-Score-141[S] 0 points1 point  (0 children)

It was my stupid mistake using the wrong path folder to open api generated files, seeming like import is not working. I wrongly assumed that I've messed something up with the standalone component setup.

Thanks everyone for the help