0.1.5 • Published 6 years ago

ng-pipes v0.1.5

Weekly downloads
512
License
MIT
Repository
github
Last release
6 years ago

ng-pipes   NPM version Build status License Join the chat at https://gitter.im/ng-pipes/Lobby

a8m/angular-filter for Angular2

This module works with Angular 2.x.

For the AngularJS 1.x version of this module, please see angular-filter.

Installation

npm install --save ng-pipes

Get Started

Import ng-pipes to your app.module.ts

import { NgPipesModule } from 'ng-pipes';
// ...

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    // ...
    NgPipesModule,
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Inject it to your class(could be Component, Service, etc..), or use it inside the view(template).

  • app.component.ts:

    import { Component } from '@angular/core';
    import { RepeatPipe } from 'ng-pipes';
    
    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css'],
      providers: [RepeatPipe],
    })
    export class AppComponent {
      constructor(private repeater: RepeatPipe) {
        this.repeater = repeater;
      }
      title = "hello world"
      manyTitles = this.repeater.transform(this.title, 10, " ");
    }
  • app.component.html:

    <h1>
      {{ title | reverse }}
    </h1>

Contributing

  • 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.

Submitting a Pull Request (PR)

  1. Clone the project via:

    $ git clone https://github.com/a8m/ng-pipes.git
  2. Make your changes in a new git branch:

    $ git checkout -b my-cool-branch master
  3. Add your changes, including appropriate test cases.

  4. Push your branch to Github.

  5. Create a PR to master.

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago