@fdot/angular-orgcode
Installation
npm install @fdot/angular-orgcode --save
Setup
import { NgModule } from '@angular/core';
import { AngularOrgcodeModule, Config } from '@fdot/angular-orgcode';
@NgModule({
declarations: [
],
imports: [
// Add the import for the Angular Dotcodes Module
AngularOrgcodeModule.forRoot(new Config('Host Url Goes Here', 'Api Key Goes Here',false,'select')),
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Module Config Options
- host - The url for the dotcodes api the module will use
- apiKey - The api key for the api call.
Orgcodes Select Component
<fdot-org-code-select (selectedOrgcode)="orgCodeChanged($event)"> </fdot-org-code-select>
Inputs
- value - The code value that should be initial selected.
- disabled - If the select should be disabled.
- useDefaultSelect - Indicates if the select should have a default no value option
- defaultSelectText - The text for the default option
Outputs
- selectedOrgCode - The dotcode that is selected
Orgcode Pipe
{{val | orgCode | async}}
AngularOrgcodeService
A service is also included in the module for making your own calls for custom components or services.
Methods
getAllOrgCodes(): Observable<OrgCode[]>
getOrgCode(orgCode: string): Observable<OrgCode>
getOrgCodeByCostCenter(costCenter: string): Observable<OrgCode>
getAllOrgCodesByDistrict(district: string): Observable<OrgCode[]>
format(orgCode: OrgCode, format: string): string