@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.