ng-pipes 教程

🌙
手机阅读
本文目录结构
a'xi'he

写在前面

Github:https://github.com/a8m/ng-pipes

Get Started

There are 3 ways of adding ng-pipes to your project: 1. Import all pipes 2. Import pipes by module 3. Declare specific pipes

Import all pipes

import { NgPipesModule } from 'ng-pipes';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    NgPipesModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
<h1>
  {{ title | reverse }}
</h1>

Import pipes by module

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>

Declare specific pipes

import { ReversePipe, CeilPipe, ... } from 'ng-pipes';
// ...

@NgModule({
  declarations: [
    AppComponent, ReversePipe, CeilPipe, ...
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
<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.

AXIHE / 精选教程

浏览全部教程

HTML

CSS

JS

关于朱安邦

我叫 朱安邦,阿西河的站长,在杭州。

以前是一名平面设计师,后来开始接接触前端开发,主要研究前端技术中的JS方向。

业余时间我喜欢分享和交流自己的技术,欢迎大家关注我的 Bilibili 和抖音。

关注我: Github / 知乎

如果你加我的私人微信,麻烦写上您的 称呼,所在地区,职业,方便我备注,谢谢


本站的微信公众号

阿西河前端教程

Anbang

安邦的私人微信

微信号: yaolushan

Anbang

Bilibili(B站)

朱安邦

Anbang