Question: I had an Angular app with `dev, prod & QA` environments.

I build it by ng build --env=QA

After building, How do I know, that it is in QA environment without deploying it to the server?

Answer: 
We can find it in dist/main.bundle.js with variable environment.

So, by this, we know which environment it is.

```
var environment = {
    production: true,
    envName: 'QA'
};

```
First, add a new property to each of the `environment.{env}.ts` files.

```
export const environment = {  
  production: false,
  envName: 'dev'
};

```

Then in the `myapp.component.ts` file import settings, and set the binding.

```
import { environment } from './environment';

export class MyappAppComponent {  
  environmentName = environment.envName;
}

```

When the application is built (ng build) or served (ng serve), the `environment.{env}.ts` file from `/environments` is pulled and replaces the file within `/src/app`. By default this is dev.