open-index/open-npm huggingface dataset:
npm package: @ngxmytestsmodules/abstracts
Description: This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.2.0.
Latest version: 0.0.3

# Abstracts

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.2.0.

## Code scaffolding

Run `ng generate component component-name --project abstracts` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project abstracts`.
> Note: Don't forget to add `--project abstracts` or else it will be added to the default project in your `angular.json` file. 

## Build

Run `ng build abstracts` to build the project. The build artifacts will be stored in the `dist/` directory.

## Publishing

After building your library with `ng build abstracts`, go to the dist folder `cd dist/abstracts` and run `npm publish`.

## Running unit tests

Run `ng test abstracts` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
npm package: @ngxp/environment
Description: Loads the Angular environment at runtime instead of build-time.
Author: Joost Zöllner
Latest version: 1.0.1

# @ngxp/environment

Loads the Angular environment at runtime instead of build-time.


## Why

Normally Angular's environment configuration is provided by importing `environment` from the `environment` folder and replaced with the specific stage configuration at build-time.

If you are working with Docker images this means you have to build a new image for each stage/environment which can be a potential cause of errors.

That's why we want to build an image _once_ and use it across all stages/environments. So we have to load environment-specific configuration at runtime instead of build-time and this library helps with that.

## Usage

In the `main.ts` file of your Angular application wrap the bootstrap logic with `fetchEnvironment(...)` and add the `ENVIRONMENT` provider to the `platformBrowserDynamic` function

```ts
import { ENVIRONMENT, fetchEnvironment } from '@ngxp/environment';

fetchEnvironment().then(env => {
    if (env.production) {
        enableProdMode();
    }

    platformBrowserDynamic([
        {
            provide: ENVIRONMENT,
            useValue: env
        }
    ])
        .bootstrapModule(AppModule)
        .catch((err) => console.error(err));
});
```

This will load a JSON configuration from `<PROTOCOL>//<HOST>/environment` before the Angular application starts. Additionally the `fetchEnvironment` function can be called with a `path` parameter

```ts
fetchEnvironment(`http://example.org/my/custom/environment.json`).then(env => {
  ...
});
```

The environment configuration can now be used by using the `ENVIRONMENT` InjectionToken in your application.

```ts
import { ENVIRONMENT } from '@ngxp/environment';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.scss']
})
export class AppComponent {

    constructor(
        private environment: ENVIRONMENT,
    ) { }
}

```


## Troubleshooting

### fetch

The `fetchEnvironment` uses the `fetch` method in the background. So you might have to install `whatwg-fetch` and add `import 'whatwg-fetch'` in your `polyfills.ts`.