angular2-pipes
Advanced tools
Comparing version 0.4.13 to 0.4.14
export declare class NgPipesModule { | ||
} | ||
export * from './pipes/array'; | ||
export * from './pipes/string'; | ||
export * from './pipes/math'; | ||
export * from './pipes/boolean'; |
@@ -11,7 +11,10 @@ "use strict"; | ||
}; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var core_1 = require('@angular/core'); | ||
var array_1 = require("./pipes/array/array"); | ||
var string_1 = require("./pipes/string/string"); | ||
var math_1 = require("./pipes/math/math"); | ||
var boolean_1 = require("./pipes/boolean/boolean"); | ||
var array_1 = require('./pipes/array'); | ||
var string_1 = require('./pipes/string'); | ||
var math_1 = require('./pipes/math'); | ||
var boolean_1 = require('./pipes/boolean'); | ||
var NgPipesModule = (function () { | ||
@@ -22,5 +25,5 @@ function NgPipesModule() { | ||
core_1.NgModule({ | ||
declarations: string_1.STRING_PIPES.concat(array_1.ARRAY_PIPES, math_1.MATH_PIPES, boolean_1.BOOLEAN_PIPES), | ||
declarations: [], | ||
imports: [], | ||
exports: string_1.STRING_PIPES.concat(array_1.ARRAY_PIPES, math_1.MATH_PIPES, boolean_1.BOOLEAN_PIPES) | ||
exports: [array_1.NgArrayPipesModule, string_1.NgStringPipesModule, math_1.NgMathPipesModule, boolean_1.NgBooleanPipesModule] | ||
}), | ||
@@ -32,3 +35,7 @@ __metadata('design:paramtypes', []) | ||
exports.NgPipesModule = NgPipesModule; | ||
__export(require('./pipes/array')); | ||
__export(require('./pipes/string')); | ||
__export(require('./pipes/math')); | ||
__export(require('./pipes/boolean')); | ||
//# sourceMappingURL=pipes.module.js.map |
{ | ||
"name": "angular2-pipes", | ||
"version": "0.4.13", | ||
"version": "0.4.14", | ||
"author": "Dan Revah", | ||
@@ -5,0 +5,0 @@ "description": "Useful angular2 pipes", |
@@ -70,25 +70,40 @@ # Angular2 Pipes | ||
1. Use npm to install the package | ||
``` | ||
$ npm install ng2-pipes --save | ||
``` | ||
```terminal | ||
$ npm install ng2-pipes --save | ||
``` | ||
2. Add into your module `imports` the `NgPipesModule` | ||
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" | ||
} | ||
// .. | ||
} | ||
``` | ||
## String | ||
@@ -95,0 +110,0 @@ |
import {NgModule} from '@angular/core'; | ||
import {ARRAY_PIPES} from "./pipes/array/array"; | ||
import {STRING_PIPES} from "./pipes/string/string"; | ||
import {MATH_PIPES} from "./pipes/math/math"; | ||
import {BOOLEAN_PIPES} from "./pipes/boolean/boolean"; | ||
import {NgArrayPipesModule} from './pipes/array'; | ||
import {NgStringPipesModule} from './pipes/string'; | ||
import {NgMathPipesModule} from './pipes/math'; | ||
import {NgBooleanPipesModule} from './pipes/boolean'; | ||
@NgModule({ | ||
declarations: [...STRING_PIPES, ...ARRAY_PIPES, ...MATH_PIPES, ...BOOLEAN_PIPES], | ||
declarations: [], | ||
imports: [], | ||
exports: [...STRING_PIPES, ...ARRAY_PIPES, ...MATH_PIPES, ...BOOLEAN_PIPES] | ||
exports: [NgArrayPipesModule, NgStringPipesModule, NgMathPipesModule, NgBooleanPipesModule] | ||
}) | ||
export class NgPipesModule {} | ||
export * from './pipes/array'; | ||
export * from './pipes/string'; | ||
export * from './pipes/math'; | ||
export * from './pipes/boolean'; |
Sorry, the diff of this file is not supported yet
257837
342
4241
752