Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit

Permalink
Fix modules and add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fknop committed Aug 10, 2016
1 parent 402e763 commit d3ac92d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 14 deletions.
33 changes: 33 additions & 0 deletions docs/modules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Modules

Angular rc.5 comes with `NgModule`.

Since version `2.2.0` you can take advantage of these modules.

Each category of pipes has an exported module. And one module imports all these modules.

* Ng2ArrayPipesModule
* Ng2MathPipesModule
* Ng2BooleanPipesModule
* Ng2StringPipesModule
* Ng2ObjectPipesModule
* Ng2AggregatePipesModule
* Ng2PipesModule (imports all the module above)


## Example

```typescript
import { NgModule } from '@angular/core';

import { Ng2ArrayPipesModule, Ng2StringPipesModule } from 'angular-pipes';

@NgModule({
imports: [
Ng2ArrayPipesModule,
Ng2StringPipesModule
]
})
export class MyApplicationModule {}

```
26 changes: 13 additions & 13 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,43 @@ export * from './src/aggregate';


@NgModule({
declarations: [NG2_ARRAY_PIPES]
exports: [NG2_ARRAY_PIPES]
})
export class Ng2ArrayPipesModule {}

@NgModule({
declarations: [NG2_MATH_PIPES]
exports: [NG2_MATH_PIPES]
})
export class Ng2MathPipesModule {}

@NgModule({
declarations: [NG2_BOOLEAN_PIPES]
exports: [NG2_BOOLEAN_PIPES]
})
export class Ng2BooleanPipesModule {}

@NgModule({
declarations: [NG2_STRING_PIPES]
exports: [NG2_STRING_PIPES]
})
export class Ng2StringPipesModule {}

@NgModule({
declarations: [NG2_OBJECT_PIPES]
exports: [NG2_OBJECT_PIPES]
})
export class Ng2ObjectPipesModule {}

@NgModule({
declarations: [NG2_AGGREGATE_PIPES]
exports: [NG2_AGGREGATE_PIPES]
})
export class Ng2AggregatePipesModule {}

@NgModule({
imports: [
Ng2ArrayPipesModule,
Ng2MathPipesModule,
Ng2BooleanPipesModule,
Ng2StringPipesModule,
Ng2ObjectPipesModule,
Ng2AggregatePipesModule
exports: [
NG2_ARRAY_PIPES,
NG2_MATH_PIPES,
NG2_BOOLEAN_PIPES,
NG2_STRING_PIPES,
NG2_OBJECT_PIPES,
NG2_AGGREGATE_PIPES
]
})
export class Ng2PipesModule {}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-pipes",
"version": "2.2.0",
"version": "2.2.1",
"description": "Angular 2 pipes library",
"main": "pipes/index.js",
"scripts": {
Expand Down

0 comments on commit d3ac92d

Please sign in to comment.