angular2-pipes
Advanced tools
Comparing version 1.0.0 to 1.1.1
{ | ||
"name": "angular2-pipes", | ||
"version": "1.0.0", | ||
"version": "1.1.1", | ||
"author": "Dan Revah", | ||
@@ -5,0 +5,0 @@ "description": "Useful angular2 pipes", |
@@ -28,2 +28,4 @@ # Angular Pipes | ||
- [match](#match) | ||
- [lpad](#lpad) | ||
- [rpad](#rpad) | ||
- [Array](#Array) | ||
@@ -266,3 +268,3 @@ - [diff](#diff) | ||
Removes accents from Latin characters. | ||
Converts a string with new lines into an array of each line. | ||
@@ -310,2 +312,26 @@ API: `string | lines` | ||
### lpad | ||
Left pad a string to a given length using a given pad character (default is a space) | ||
API: `string | lpad: length: [padCharacter:string|optional]` | ||
```html | ||
<p>{{'foo' | lpad: 5}}</p> <!-- Output: " foo" --> | ||
<!-- Cast a number to string in order to left pad it with zeros --> | ||
<p>{{String(3) | lpad: 5: '0'}}</p> <!-- Output: "00003" --> | ||
``` | ||
### rpad | ||
Right pad a string to a given length using a given pad character (default is a space) | ||
API: `string | rpad: length: [padCharacter:string|optional]` | ||
```html | ||
<p>{{'Foo' | rpad: 5: '#'}}</p> <!-- Output: "Foo##" --> | ||
``` | ||
## Array | ||
@@ -312,0 +338,0 @@ |
@@ -21,1 +21,3 @@ import { LinesPipe } from './lines'; | ||
export * from './test'; | ||
export * from './lpad'; | ||
export * from './rpad'; |
@@ -31,2 +31,4 @@ "use strict"; | ||
var test_1 = require('./test'); | ||
var lpad_1 = require('./lpad'); | ||
var rpad_1 = require('./rpad'); | ||
exports.STRING_PIPES = [ | ||
@@ -36,3 +38,3 @@ ltrim_1.LeftTrimPipe, repeat_1.RepeatPipe, rtrim_1.RightTrimPipe, scan_1.ScanPipe, shorten_1.ShortenPipe, | ||
camelize_1.CamelizePipe, latinise_1.LatinisePipe, lines_1.LinesPipe, underscore_1.UnderscorePipe, match_1.MatchPipe, | ||
test_1.TestPipe | ||
test_1.TestPipe, lpad_1.LeftPadPipe, rpad_1.RightPadPipe | ||
]; | ||
@@ -69,3 +71,5 @@ var NgStringPipesModule = (function () { | ||
__export(require('./test')); | ||
__export(require('./lpad')); | ||
__export(require('./rpad')); | ||
//# sourceMappingURL=index.js.map |
@@ -18,2 +18,4 @@ import {NgModule} from '@angular/core'; | ||
import {TestPipe} from './test'; | ||
import {LeftPadPipe} from './lpad'; | ||
import {RightPadPipe} from './rpad'; | ||
@@ -24,3 +26,3 @@ export const STRING_PIPES = [ | ||
CamelizePipe, LatinisePipe, LinesPipe, UnderscorePipe, MatchPipe, | ||
TestPipe | ||
TestPipe, LeftPadPipe, RightPadPipe | ||
]; | ||
@@ -51,1 +53,3 @@ | ||
export * from './test'; | ||
export * from './lpad'; | ||
export * from './rpad'; |
Sorry, the diff of this file is not supported yet
375851
403
5537
1001