阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      ng-pipes 教程

      写在前面

      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.

      卖前端学习教程

      只需几十元,就能买到培训班的内部教程!开启高薪之路!

      零基础小白阿里P7的教程都有!

      同时长期收购所有培训班的前端教程

      目录
      目录