wndatamapper
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

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

Package Sidebar

Install

npm i wndatamapper

Weekly Downloads

3

Version

0.0.7

License

none

Unpacked Size

21 kB

Total Files

16

Last publish

Collaborators

  • winniezero