# Epom-ng2-terms
Implements terms button witch opens popup or redirect to another page (depends on strategy) by clicking on it.

### Prerequisites

| Name | Description |
| ---- | ----------- |
| `epom-ng2-popup` | We need to open popup in one of the strategies |

Install `epom-ng2-popup`via npm:

```sh
$ npm install epom-ng2-popup
```
### Installing

First of all you need to import `TermsModule` in your module where do you want to user it:
```typescript
import {TermsModule} from 'epom-ng2-terms/Terms.module';
...
imports: [
    TermsModule,
    ...
];
```

## Parts
    .
    |-- epom-ng2-terms
    |-- |-- Terms.module
    |   |-- Terms
    |   |-- TermsPopup
    |   |-- TermsRedirect
    |   |-- Terms.types
    |   |-- Terms.enums
    |   |-- TermsStrategy.interface

## Input properties (@Input)
| Name             | Type | Description                   |
| ---------------- | ---- | ----------------------------- |
| **config** | ConfigTermsPopup \| ConfigTermsRedirect | Config terms button, here provides link for redirect or popupConfig and terms text |
| **configStream** | BehaviorSubject \|\| BehaviorSubject of Config |
| **type** | TermsType | one of types that described in enum: TermsType.popup \|\| TermsType.redirect |

Examples:
In your component template:
```html
    <li><terms [config]="termsSetup"></terms></li>
    <li><terms [configStream]="termsSetupStream"></terms></li>
```


## Module Examples

```typescript
    private termsSetup = {...POPUP_DEFAULT_CONFIG, text: 'Some terms text'};
```

## Contributors

Gennady Strelets <g.strelets@itmgmedia.net>
