Coder Social home page Coder Social logo

nangal / ng-pipes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from a8m/ng-pipes

0.0 3.0 0.0 227 KB

Bunch of useful pipes for Angular2 (with no external dependencies!)

Home Page: https://a8m.github.io/ng-pipes/

License: MIT License

JavaScript 0.78% TypeScript 99.22%

ng-pipes's Introduction

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
  1. Make your changes in a new git branch:
$ git checkout -b my-cool-branch master
  1. Add your changes, including appropriate test cases.

  2. Push your branch to Github.

  3. Create a PR to master.

ng-pipes's People

Contributors

a8m avatar gitter-badger avatar rafaelss95 avatar stevevanopstal avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.