Angular BASE_URL replacement in Angular 18?

Discussão em 'Angular' iniciado por Carl S., Novembro 23, 2025.

  1. Carl S.

    Carl S. Guest

    For Angular 6.0-8.0 used with .Net Core 3.1 it was possible to inject the "BASE_URL" as string in constructor.

    What is now the equivalent for the "BASE_URL" in Angular 18 + .NET 8 ?

    How should I approch this to get relevant path in local test and production ?

    Old great and working way from the past below:


    constructor(private http: HttpClient, @Inject('BASE_URL') private baseUrl: string) {
    }

    Continue reading...

Compartilhe esta Página