0.0.7 • Published 7 months ago

wndatamapper v0.0.7

Weekly downloads
-
License
-
Repository
-
Last release
7 months ago

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
0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago