Readdy Write

Angular: Environments.ts fehlt

02.02.2023 (👁2106)

Angular: Environments.ts fehlt

Problem Angular:

Beim Erstellen der Angular Anwendung fehlt die environments.ts datei.

Ein Bild, das Text, Screenshot, Bildschirm enthält.

Automatisch generierte Beschreibung

Lösung:

ng g environments

Mit dem Befehl ng g environments werden die Dateien erstellt

Ein Bild, das Text, Screenshot, Monitor, computer enthält.

Automatisch generierte Beschreibung

Ordner

Ein Bild, das Text enthält.

Automatisch generierte Beschreibung 

Environment.ts

// This file can be replaced during build by using the `fileReplacements` array.

// `ng build` replaces `environment.ts` with `environment.prod.ts`.

// The list of file replacements can be found in `angular.json`.

 

export const environment = {

    production: false

  };

   

 

 

Environment.prod.ts

export const environment = {

    production: true

  };

 

 

URL eintragen in Environtment.ts

Die URL ergänzt man dann in der environment datei

export const environment = {

    production: false,

    apiUrl:"https://localhost:7073/api/Articles"

  };


0,00 €