Wondering what’s next for npm?Check out our public roadmap! »

    @kaipio/api
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.3 • Public • Published

    @kaipio/api library

    This library was generated with Angular CLI version 10.1.2.

    Components use Bootstrap 4 for UI by default.

    This library contains some Angular components, that will consume data operations from our api.kaipio.com server.

    Components

    FinnArea component

    This component allows user to select area information from Finland in UI.

    Examples

    See example in our website https://www.kaipio.com/aps/finnareaui/angular. Created with ASP.NET C# MVC.

    Usage

    Add import to your app.module.ts

    import { ApiModule} from '@kaipio/api';
    

    Add import in your app.module.ts imports

    ApiModule.forRoot({ showFinnareaCity: true, showFinnareaCounty: true, showFinnareaRegion: true, showFinnareaSelectionInfo: true }),
    

    You can use forRoot parameters to configure component parts visibility. If you set all to true, you will get all UI elements. You can also use any config combinations to get UI you need.

    If you need to set component parts visibility at runtime, you can use property setter functions to do that.

    setSelectionInfoVisible(false); // hide selection info 
    
    setRegionSelection(); // set to show only region selection
    
    setCountySelection(); // set to show only county selection
    
    setCitySelection(); // set to show only city selection
    

    You can receive selection info from component using events. Add this code to your app.components.ts to get city selection to console:

    private cityEvent: CustomEvent;
      
    ngOnInit() {
        fromEvent(document, 'CitySelected').subscribe(cityEv => {
          this.cityEvent = cityEv as CustomEvent;
          console.log(this.cityEvent.detail.City);      
        });
    }
    
    

    Other events are CountySelected and RegionSelected.

    License

    When version 1.0.0 is published, the library will be commercial and will require license to be purchased.

    Copyright © 2020 T:mi Jari Kaipio. All rights reserved.

    Keywords

    none

    Install

    npm i @kaipio/api

    DownloadsWeekly Downloads

    1

    Version

    0.1.3

    License

    MIT

    Unpacked Size

    788 kB

    Total Files

    27

    Last publish

    Collaborators

    • avatar