hoppysearch - AngularJS client for AddressService
This project was generated with Angular CLI version 17.2.0
For Angular.js
- Simplify your integration process with this user-friendly Angular component.
- Automatic suggestions for the Address input field.
- Address fields auto-populate upon users selection.
- Editable data fields allowing users to easily update their information, including the option to input addresses effortlessly.
To preview the future appearance of the Angular Component, visit the following website:Address Service Angular Demo
Proceed with the installation by following these steps:
npm install address-service-angular --save
Please follow the installation instructions and execute the following AngularJS code:
- Add Angular Material to your project:
ng add @angular/material
- Install the required Axios library:
npm i axios
- Install the address-service-angular package in your Angular project:
npm i address-service-angular
- Import the AddressServiceAngularComponent in your Angular component:
import { AddressServiceAngularComponent } from 'address-service-angular';
- Add the component to your Angular module imports:
@Component({
imports: [RouterOutlet, AddressServiceAngularComponent],
})
- Add the component tag in your HTML file:
<lib-address-service-angular></lib-address-service-angular>
- If you want to access/modify the selected adderess, then create a function and bind that function to component tag in HTML file like below.
<!-- Full Code -->
import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { AddressServiceAngularComponent } from 'address-service-angular';
@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet,AddressServiceAngularComponent],
templateUrl: './app.component.html',
styleUrl: './app.component.css'
})
export class AppComponent {
title = 'address-service';
handleAddressChange(data: any) {
console.log('Received data from child:', data);
}
}
<lib-address-service-angular (onAddressChange)="handleAddressChange($event)"></lib-address-service-angular>
- And Run ng serve for a dev server. Navigate to http://localhost:3000/. The application will automatically reload if you change any of the source files.
ng serve