groupcenter-dropdown-ciudades-frontend
v0.1.2
Published
## Installation
Downloads
3
Readme
groupcenter-dropdown-ciudades-frontend
Installation
To install this library, run:
$ npm install groupcenter-dropdown-ciudades-frontend --save
$ npm install groupcenter-modelos-base-frontend --save
Consuming your library
Then from your Angular AppModule
:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import your library
import { DropdownCiudadesModule } from 'groupcenter-dropdown-ciudades-frontend';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
// Specify your library as an import
DropdownCiudadesModule.forRoot()
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Once your library is imported, you can use its components, directives and pipes in your Angular application:
<!-- You can now use your library component in app.component.html -->
<h1>
{{title}}
</h1>
<dropdown-ciudades [dName]="'dropdown-ciudades'" [dText]="'Seleccione una ciudad...'"
[config]="config" (objectSelected)="myFunction($event)"
[codigoDepartamento]="'CO05'" [codigoPais]="'CO'"> </dropdown-ciudades>
There are some required parameters to works explained below.
Parameters
"INPUT"
[dName]: Name for the tag, by default: 'dropdown-ciudades', (OPTIONAL) [dText]: Default option for select, by default: 'Seleccione una ciudad', (OPTIONAL) [config]: Credentials to consume the policy service to get city data, (REQUIRED*) [codigoDepartamento]: Parameter required ti get city data, (REQUIRED*) [codigoPais]: Paremetr required to get city data, (REQUIERED*)
"OUTPUT" (objectSelected): returns a $event with the city information, you can pass it to a var or a function as paramter
Adding to SystemConfig or ProjectConfig
You must add to systemjs.config.ts or project.config.ts file below information:
System.config({
...
map:{
...
'groupcenter-modelos-base-frontend': 'npm:groupcenter-modelos-base-frontend/groupcenter-modelos-base-frontend.umd.js'
'groupcenter-modelos-base-frontend': 'npm:groupcenter-dropdown-ciudades-frontend/groupcenter-dropdown-ciudades-frontend.umd.js'
}
License
MIT � Marlon Olaya