# ngx-lorem-ipsum

> Angular2 lorem ipsum generator

Latest version **0.1.1** (published 2017-03-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-lorem-ipsum
pnpm add ngx-lorem-ipsum
yarn add ngx-lorem-ipsum
bun add ngx-lorem-ipsum
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2017-03-27 |
| First published | 2017-03-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Łukasz Gałka |
| Maintainers | lukasz-galka |
| Keywords | ngx, angular2, lorem ipsum, lorem |

## Links

- npm: https://www.npmjs.com/package/ngx-lorem-ipsum
- Repository: https://github.com/lukasz-galka/ngx-lorem-ipsum
- Homepage: https://github.com/lukasz-galka/ngx-lorem-ipsum#readme
- Issues: https://github.com/lukasz-galka/ngx-lorem-ipsum/issues
- npm.io page: https://npm.io/package/ngx-lorem-ipsum

## Recent versions

- 0.1.1 (latest) — 2017-03-27
- 0.1.0 — 2017-03-22

## README

[![npm version](https://img.shields.io/npm/v/ngx-lorem-ipsum.svg)](https://www.npmjs.com/package/ngx-lorem-ipsum)
[![Downloads](https://img.shields.io/npm/dm/ngx-lorem-ipsum.svg)](https://www.npmjs.com/package/ngx-lorem-ipsum)

# NgxLoremIpsum
Angular2 lorem ipsum generator

# Demo
[Link](https://lukasz-galka.github.io/ngx-lorem-ipsum-demo/)

# Installation
```npm install ngx-lorem-ipsum --save```

# Service Methods
- `get(count: number, paragraphsCount: number = 0): string` - gets sentences and paragraphs count and returns text
- `getRandom(min: number, max: number, paragraphsCount: number = 0): string ` - gets min/max for sentences count and paragraphs count and returns text 

(if `paragraphsCount` is 0 returns plain text, if `paragraphsCount` is N returns html with N paragraphs `<p>`)

# Service Usage
````ts
// app.module.ts
import { NgxLoremIpsumModule } from 'ngx-lorem-ipsum';
...
@NgModule({
    imports: [
        ...
        NgxLoremIpsumModule
        ...
    ],
    ...
})
export class AppModule { }
````

````ts
// app.component.ts
import { NgxLoremIpsumService } from 'ngx-lorem-ipsum';
...

@Component({
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.scss'],
})
export class AppComponent {    

    text: string;
    randomText: string;

    constructor(private service: NgxLoremIpsumService) {
        this.text = this.service.get(10, 2);
        this.randomText = this.service.getRandom(10, 20, 5);
    }
}

````

````html
// app.component.html
<div [innerHTML]="text"></div>
<div [innerHTML]="randomText"></div>
````

# Component Options
- `count` | Type: `number` - sentences count (ignored when min and max defined)
- `min` | Type: `number` - min sentences count
- `max` | Type: `number` - max sentences count
- `paragraphsCount` | Type: `number` | Default value: `0` - paragraphs count (if 0 returns plain text, if N returns html with N paragraphs `<p>`)

# Component Usage
````ts
// app.module.ts
import { NgxLoremIpsumModule } from 'ngx-lorem-ipsum';
...
@NgModule({
    imports: [
        ...
        NgxLoremIpsumModule
        ...
    ],
    ...
})
export class AppModule { }
````

````html
// app.component.html
<ngx-lorem-ipsum [count]="10"></ngx-lorem-ipsum>
<ngx-lorem-ipsum [count]="10" [paragraphsCount]="2"></ngx-lorem-ipsum>
<ngx-lorem-ipsum [min]="10" [max]="20" [paragraphsCount]="5"></ngx-lorem-ipsum>
````

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