ProductPromotion
Logo

Angular.JS

made by https://0x3d.site

GitHub - d-koppenhagen/ngx-lipsum: Easily use lorem-ipsum dummy texts in your angular app as directive, component or by using a service
Easily use lorem-ipsum dummy texts in your angular app as directive, component or by using a service - d-koppenhagen/ngx-lipsum
Visit Site

GitHub - d-koppenhagen/ngx-lipsum: Easily use lorem-ipsum dummy texts in your angular app as directive, component or by using a service

GitHub - d-koppenhagen/ngx-lipsum: Easily use lorem-ipsum dummy texts in your angular app as directive, component or by using a service

ngx-lipsum

npm npm PRs Welcome Open Source Love

npm npm npm npm

Easily use lorem-ipsum dummy texts in your angular app as directive, component or by using a service.

ngx-lipsum Logo

Usage & Defaults

All generated texts are based on the lorem-ipsum NPM package and it's configuration defined by the ILoremIpsumParams interface. In most cases this package uses the defaults by passing no further option / an empty object.

Service and Standalone Component / Directive

This package provides:

  • the LipsumService
  • the ngx-lipsum-Component that can be used as a standalone Component
  • the lipsum-Directive which is also exported as standalone Directive

Directive Usage

Using the lipsum-Directive allows you to fill most HTML Elements with lorem ipsum content (some won't make sense like video, audio, iframe, etc.). By default the generated text will simply be inserted. The defaults here depending on the target HTML-Element. You can find them at the top of the implementation

<!-- input elements (text is bound to `value`) -->
<textarea [lipsum]></textarea>
<input [lipsum]="{ count: 10, unit: 'words' }" />
<!-- with custom config -->

<!-- list elements (`li`-child will automatically be created for each paragraph) -->
<ul [lipsum]></ul>
<ol [lipsum]="{ count: 20, unit: 'paragraphs' }"></ol>
<!-- with custom config -->

<!-- common elements (text is bound to `innerText`) -->
<li [lipsum]></li>
<p [lipsum]="{ count: 40, unit: 'sentences' }"></p>
<!-- with custom config -->
<a [lipsum]></a>

Component Usage

You can use the ngx-lipsum-Component in your template and pass through an optional configuration object as config input property binding.

<!-- using defaults -->
<ngx-lipsum></ngx-lipsum>

<!-- using custom config -->
<ngx-lipsum [config]="{ count: 5, unit: 'paragraphs' }"></ngx-lipsum>

Service usage

When you want to use the service to generate a lorem ipsum text in your classes, you need to inject the service and call the get-method to retrieve the text. You can pass through any config from the lorem-ipsum NPM package.

import { Component } from '@angular/core';
import { LipsumService } from 'ngx-lipsum';

@Component({
  selector: 'my-component',
  template: '<span>{{ lipsumText }}</span>',
})
export class MyComponent {
  public lipsumText: string;
  constructor(lipsum: LipsumService) {
    this.lipsumText = lipsum.get(/* { count: 3, unit: 'sentences' } */);
  }
}

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory