NgxLoremIpsum
Angular2 lorem ipsum generator
Demo
Installation
npm install ngx-lorem-ipsum --save
Service Methods
get(count: number, paragraphsCount: number = 0): string
- gets sentences and paragraphs count and returns textgetRandom(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
// app.module.ts;...
// app.component.ts;...
// app.component.html
Component Options
count
| Type:number
- sentences count (ignored when min and max defined)min
| Type:number
- min sentences countmax
| Type:number
- max sentences countparagraphsCount
| Type:number
| Default value:0
- paragraphs count (if 0 returns plain text, if N returns html with N paragraphs<p>
)
Component Usage
// app.module.ts;...
// app.component.html