1.0.4 • Published 3 years ago

@mantec/ngx-address-finder v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

NgxAddressFinder

This library was generated with Angular CLI version 11.0.1.

Angular adapter for Address Finder

gif

Import Module

In your Angular application, add the following code to app.module.ts

imports: [
    ...,
    NgxAddressFinderModule.forRoot({
      API_COUNTRY: "AU",
      API_KEY: "YOUR_KEY_HERE"
    })
    ...
  ],

Directive Usage

In MyForm.component.html

<input ngxAddressFinder 
       [(ngModel)]="addressString" 
       (ngModelChange)="myFunction1()" 
       (addressChange)="myFunction2($event)">

In MyForm.component.ts

....
public addressString: string = "";
...

myFunction1() {
    console.log(this.addressString)
}

myFunction2(evt: addressInterface) {
    console.log(evt)
}

Component Usage

In MyForm.component.html

<ngx-address-finder mode="material" 
                    [(ngModel)]="addressObject" 
                    (ngModelChange)="yourFunction()"></ngx-address-finder>
AttributeAvailable Value
modematerial bootstrap

Two-way Binding

Use [(ngModel)] + (ngModelChange) as normal input field.

Address Interface

export interface AddressInterface{
  addressLine1?: string,
  addressLine2?: string,
  suburb?: string,
  state?: string,
  postcode?: string,
  metaData?: any,
  fullAddress?: string
}

Code scaffolding

Run ng generate component component-name --project ngx-address-finder to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-address-finder.

Note: Don't forget to add --project ngx-address-finder or else it will be added to the default project in your angular.json file.

Build

Run ng build ngx-address-finder to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build ngx-address-finder, go to the dist folder cd dist/ngx-address-finder and run npm publish.

Running unit tests

Run ng test ngx-address-finder to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.

1.0.4

3 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago