Dipi
A simple Angular library that contain a huge, useful pack of Directives and Pipes for Angular developers.
Quick Start
- Install
Dipi
library:
$ npm i dipi -D
- Import
DipiModule
inside your Angular module:
....
import { DipiModule } from 'dipi';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
DipiModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Documentation
Website documentation is in development.
Pipes
join | join
Default value
<p>{{ textList | join }}</p> <!-- Dipi,is,working! -->
Custom value
<p>{{ textList | join: ' ' }}</p> <!-- Dipi is working! -->
safe | safe
Default value: url
. Possible values: 'html' | 'css' | 'js' | 'url' | 'res-url'
Default value
<iframe [src]="'https://www.w3schools.com' | safe"></iframe>
Custom value
<p [style]="'color: red' | safe: 'style'">Red text</p>
filter | filter
Default value
textList = [
{
name: 'Dipi',
available: true,
},{
name: 'is',
available: true,
},{
name: 'working!',
available: true,
},{
name: 'Hide me',
available: false
}
]
<p>
<ng-container *ngFor="let node of textList | filter">
<span>{{ node.name }} </span>
</ng-container>
</p>
Custom value
<p>
<ng-container *ngFor="let node of textList | filter : 'name'">
<span>{{ node.name }} </span>
</ng-container>
</p>
searchFilter | searchFilter
Directives
debounce [debounce]
Default value
<h2>Dipi Seed</h2>
<input type="search"
[debounce]
[(ngModel)]="search"
(debouceEvent)="filterSearch()">
<p>
<ng-container *ngFor="let node of filteredList">
<span>
{{ node.name }}
</span>
</ng-container>
</p>
Custom value
<h2>Dipi Seed</h2>
<input type="search"
[debounce]="2000"
[(ngModel)]="search"
(debouceEvent)="filterSearch()">
<p>
<ng-container *ngFor="let node of filteredList">
<span>
{{ node.name }}
</span>
</ng-container>
</p>
lazyFor *lazyFor
offsetHeight offsetHeight
In Development
Pipes:
| distinct
| formatter
| timer
Directives:
Website documentation
Help
I will be so glad if you will create an issue with your own useful Directive
or Pipe
that will be used by other Angular developers .
Knowledge sharing is our strength!
Contributing
Please read contributing guidelines here.
License
MIT
8.2.0
6 years ago
8.2.1
6 years ago
1.1.0
7 years ago
1.0.0
7 years ago
1.0.0-alpha.1
7 years ago
1.0.0-alpha.0
7 years ago