srs-map-data
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

SRS-Map-Data

Simple pipe for match and transformation data.

Table of Contents

Installation

$ npm i srs-map-data

Usage

To use SrsMapDataPipe in your Angular project, import the SrsMapDataModule into your module and add it to your template.For example, to use the mapdata pipe:

In your app.module:

import { SrsMapDataModule } from 'srs-map-data';

    @NgModule({
        // ...
        imports: [
            // ...
            SrsMapDataModule,
            // ...
        ],
        // ...
    })
export class AppModule { }

In your component's template:

<p>{{ data | mapdata : 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" | mapdata : 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 srs-map-data

Weekly Downloads

0

Version

0.0.1

License

none

Unpacked Size

20.7 kB

Total Files

16

Last publish

Collaborators

  • winniezero