Skip to content

Commit

Permalink
README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
danrevah committed Nov 27, 2016
1 parent 00c2ac3 commit df6de71
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,38 +70,38 @@

1. Use npm to install the package

```terminal
$ npm install ng2-pipes --save
```
```terminal
$ npm install ng2-pipes --save
```

2. You could either add into your module `imports` the `NgPipesModule` in order to add all of the pipes, Or add a specific module such as `NgArrayPipesModule`, `NgStringPipesModule`, `NgMathPipesModule` or `NgBooleanPipesModule`.

```typescript
import {NgPipesModule} from 'ng2-pipes';

@NgModule({
// ...
imports: [
```typescript
import {NgPipesModule} from 'ng2-pipes';

@NgModule({
// ...
NgPipesModule
]
})
```
imports: [
// ...
NgPipesModule
]
})
```

3. Pipes are also injectable and can be used in Components / Services / etc..

```typescript
@Component({
// ..
providers: [ReversePipe]
})
export class AppComponent {
constructor(private reversePipe: ReversePipe) {
this.reversePipe.transform('foo'); // Returns: "oof"
```typescript
@Component({
// ..
providers: [ReversePipe]
})
export class AppComponent {
constructor(private reversePipe: ReversePipe) {
this.reversePipe.transform('foo'); // Returns: "oof"
}
// ..
}
// ..
}
```
```



Expand Down

0 comments on commit df6de71

Please sign in to comment.