a8m/angular-filter for Angular (2+)
For the AngularJS version of this module, please see angular-filter.
npm install --save ng-pipes
or
yarn add ng-pipes
There are 3 ways of adding ng-pipes to your project:
import { NgPipesModule } from 'ng-pipes';
@NgModule({
declarations: [
AppComponent
],
imports: [
NgPipesModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
<h1>
{{ title | reverse }}
</h1>
import {BooleanPipesModule, CollectionPipesModule, MathPipesModule, ObjectPipesModule, StringPipesModule} from 'ng-pipes';
@NgModule({
declarations: [
AppComponent
],
imports: [
BooleanPipesModule, // imports all pipes of the boolean module
CollectionPipesModule, // imports all pipes of the collection module
MathPipesModule, // imports all pipes of the math module
ObjectPipesModule, // imports all pipes of the object module
StringPipesModule // imports all pipes of the string module
],
bootstrap: [AppComponent]
})
export class AppModule { }
<h1>
{{ title | reverse }}
</h1>
import { ReversePipe, CeilPipe, ... } from 'ng-pipes';
// ...
@NgModule({
declarations: [
AppComponent, ReversePipe, CeilPipe, ...
],
bootstrap: [AppComponent]
})
export class AppModule { }
<h1>
{{ title | reverse }}
</h1>
- Any contribution is appreciated.
- If you are planning to add a new pipe (or any other feature), please open an issue before.
- Angular Commit Message Format is preferred.
- Clone the project via:
$ git clone https://github.com/a8m/ng-pipes.git
- Make your changes in a new git branch:
$ git checkout -b my-cool-branch master
-
Add your changes, including appropriate test cases.
-
Push your branch to Github.
-
Create a PR to master.