# ngx-dynamic-host

> Ngx dynamic component host module.

Latest version **1.1.2** (published 2018-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-dynamic-host
pnpm add ngx-dynamic-host
yarn add ngx-dynamic-host
bun add ngx-dynamic-host
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2018-09-09 |
| First published | 2018-09-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 114.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | oktykrk |
| Keywords | ng, ngx, angular, dynamic, component, host, loader, view |

## Links

- npm: https://www.npmjs.com/package/ngx-dynamic-host
- Repository: https://github.com/oktykrk/ngx-dynamic-host
- Homepage: https://github.com/oktykrk/ngx-dynamic-host#readme
- Issues: https://github.com/oktykrk/ngx-dynamic-host/issues
- npm.io page: https://npm.io/package/ngx-dynamic-host

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 1.1.2 (latest) — 2018-09-09
- 1.1.1 — 2018-09-09
- 1.1.0 — 2018-09-09
- 1.0.9 — 2018-09-09
- 1.0.8 — 2018-09-09
- 1.0.7 — 2018-09-08
- 1.0.6 — 2018-09-08
- 1.0.5 — 2018-09-08
- 1.0.4 — 2018-09-08
- 1.0.3 — 2018-09-08
- 1.0.2 — 2018-09-08
- 1.0.1 — 2018-09-08
- 1.0.0 — 2018-09-06

## README

# DynamicHost ![CI status](https://img.shields.io/badge/build-passing-brightgreen.svg)
Ngx dynamic component host module.

## Installation
```
npm install ngx-dynamic-host
```

app.module.ts
```
import { DynamicHostModule } from 'ngx-dynamic-host'; 

... 
imports: [
    ...
    DynamicHostModule
    ...
] 
... 
```

## Usage
```
<ng-template ngx-dynamic-host [dynamicHostConfig]="{ selector: '{selectorOfTargetComponent}' }"></ng-template>
```
***WARNING - Be sure to add your component to 'entryComponents'.
## Configuration

```
import { Injector, ComponentFactory, NgModuleRef } from "@angular/core";

/**
* Dynamic host configuration interface.
*/
export interface DynamicHostConfig {
    
    /**
    * The selector of the target component.
    * The host finds the factory via selector and creates the instance of the component.
    * **If both 'selector' and 'componentFactory' are provided, 'componentFactory' value will be used.
    * [OPTIONAL]
    */
    selector?: string;
    
    /**
    * Inputs that passed to target component.
    * [OPTIONAL]
    */
    inputs?: any;
    
    /**
    * Outputs that passed to target component.
    * [OPTIONAL]
    */
    outputs?: any;
    
    /**
    * Factory of target component.
    * [OPTIONAL]
    */
    factory?: ComponentFactory<any>;
    
    /**
    * You can optionally specify the {@link Injector} that will be used as parent for the Component.
    * [OPTIONAL]
    */
    injector?: Injector;
}

```

## License
[MIT](https://choosealicense.com/licenses/mit/)

---
_Source: https://npm.io/package/ngx-dynamic-host · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
