From 8a09d0db6a8a032467fdb3dec25c0dd23f6b677e Mon Sep 17 00:00:00 2001 From: Vito Date: Mon, 26 Nov 2018 16:15:50 +0000 Subject: [PATCH] [ADF-3615] created a pipe to replace empty space in strings with a special character (#4005) --- docs/core/format-space.pipe.md | 28 +++++++++ lib/core/form/components/form.component.html | 2 +- lib/core/pipes/format-space.pipe.spec.ts | 65 ++++++++++++++++++++ lib/core/pipes/format-space.pipe.ts | 34 ++++++++++ lib/core/pipes/pipe.module.ts | 10 ++- 5 files changed, 135 insertions(+), 4 deletions(-) create mode 100644 docs/core/format-space.pipe.md create mode 100644 lib/core/pipes/format-space.pipe.spec.ts create mode 100644 lib/core/pipes/format-space.pipe.ts diff --git a/docs/core/format-space.pipe.md b/docs/core/format-space.pipe.md new file mode 100644 index 0000000000..70e2d42247 --- /dev/null +++ b/docs/core/format-space.pipe.md @@ -0,0 +1,28 @@ +--- +Added: v2.0.0 +Status: Active +Last reviewed: 2018-11-19 +--- + +# Format Space pipe + +Replace all the white space in a string into a character given. + +## Basic Usage + + + +```HTML +
+ BATTLESTAR GALACTICA +
+``` + + + +## Details + +The pipe will replace all the white space between the string into `_` by default and will transform the string in lowercase (ex. `test a pipe` => `test_a_pipe`). +It is possible specify a different character for the replacing by passing the character you want in input. +It is possible avoid the transformation into lowercase by passing `false` for the `lowercase` option. + diff --git a/lib/core/form/components/form.component.html b/lib/core/form/components/form.component.html index 8ffc2dede4..f5cf0dec1f 100644 --- a/lib/core/form/components/form.component.html +++ b/lib/core/form/components/form.component.html @@ -37,7 +37,7 @@ -