wndatamapper
v0.0.7
Published
Simple pipe for match and transformation data.
Downloads
2
Maintainers
Readme
Wndatamapper
Simple pipe for match and transformation data.
Table of Contents
Installation
$ npm i wndatamapper
Usage
To use WndatamapperPipe in your Angular project, import the WndatamapperModule into your module and add it to your template.For example, to use the datamapper
pipe:
import { WndatamapperModule } from 'wndatamapper';
@NgModule({
// ...
imports: [
// ...
WndatamapperModule,
// ...
],
// ...
})
export class AppModule { }
In your component's template:
<p>{{ data | datamapper : arg1 : arg2 : arg3 }}</p>
arg1
Your data list
arg2
Key value of input
arg3
Key value of output
Example
In your component's template:
<p>{{ "TH" | datamapper : list : "code" : "name" }}</p>
In your component's script:
list = [
{
code: 'TH',
name: 'Thailand',
},
{
code: 'JP',
name: 'Japan',
},
{
code: 'UK',
name: 'United Kingdom',
},
{
code: 'UK',
name: 'United Kingdom',
},
];
// Pipe Output : Thailand