3.1.71 • Published 9 months ago

@autoaddress.com/aa3-control v3.1.71

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

README

How do I get set up?

  • run npm install "@autoaddress.com/aa3-control" to download the library

  • Reference the autoaddress.min.js file inside your html header tag, pointing to the appropriate directory

	<script src="node_modules/@autoaddress.com/aa3-control/autoaddress/autoaddress.min.js"></script>
	<link rel="stylesheet" href="node_modules/@autoaddress.com/aa3-control/autoaddress/autoaddress-style.css">
  • Add the folowing tag inside your html body tag
	<div id="aa-control"></div>
  • Add the following in a script tag after the body, replacing the apiKey parameter with your autoaddress ApiKey.
	<script>
        var aa = Autoaddress({
            apiKey: "my_key",
            element: "aa-control"
        });
	</script>

Angular Setup

In your Angular Project. Run the following steps:

  • run npm install "@autoaddress.com/aa3-control" to download the library
  • In your angular.json file in your Angular environment, add these references to the autoaddress files from the node_modules in your styles and scripts section of your build scripts as shown below:
"styles": [
    "node_modules/@autoaddress.com/aa3-control/autoaddress/autoaddress-style.css",
],
"scripts": [
    "node_modules/@autoaddress.com/aa3-control/autoaddress/autoaddress.min.js",
]
  • Also add the code block shown below to the asset section of the angular.json in your build script:
 "assets": [
    { 
    	"glob": "**/*", 
        "input": "./node_modules/@autoaddress.com/aa3-control/autoaddress/assets/images/", 
        "output": "./assets/images/" 
    },
	"src/favicon.ico",
    "src/assets"
],
  • In your component, declare the Autoaddress function as shown in the example component below in your component's typescript file (*.component.ts file):
import { Component, OnInit } from '@angular/core';
declare function Autoaddress(options: any): void

@Component({
  selector: 'app-custom',
  templateUrl: './custom.component.html',
  styleUrls: ['./custom.component.scss']
})
export class CustomComponent implements OnInit {
  • To call the Autoaddress, follow the example below. The example demonstrates intializing the Autoaddress control, setting the options for the Autoaddress control (Please refer to our Helpscout page for a list of additional options),and using callbacks when interacting with the control.
import { Component, OnInit } from '@angular/core';
declare function Autoaddress(options: any): void

@Component({
  selector: 'app-custom',
  templateUrl: './custom.component.html',
  styleUrls: ['./custom.component.scss']
})
export class CustomComponent implements OnInit {

  control: any;

  constructor() { }

  ngOnInit(): void {

    this.control = Autoaddress({
      apiKey: "pub_xxxxxxxxxxxxxxxxx",
      elementId: "aa-control",
      onPostLookup: function (result: any) {
        console.log(result);
      }
    });
  }

}

In this example we are initializing Autoaddress when the Init event for our custom component is called.

Once Autoaddress has been set up in typescript, go to the html part of your component (*.component.html). and add the following:

<div id="aa-control"></div>
  • You can call functions for the Autoaddress control once it has been initialized as show below using the example from above. (Please refer to our Helpscout page to get a list of functions for the control):
this.control.setSearch("89-94 Capel Street");
3.1.71

9 months ago

3.1.67

1 year ago

3.1.66

1 year ago

3.1.69

1 year ago

3.1.68

1 year ago

3.1.70

1 year ago

3.1.65

1 year ago

3.1.64

1 year ago

3.1.63

1 year ago

3.1.62

1 year ago

3.1.61

1 year ago

3.1.60

2 years ago

3.1.59

2 years ago

3.1.56

2 years ago

3.1.55

2 years ago

3.1.58

2 years ago

3.1.57

2 years ago

3.1.54

2 years ago

3.1.53

2 years ago

3.1.34

2 years ago

3.1.33

2 years ago

3.1.36

2 years ago

3.1.35

2 years ago

3.1.38

2 years ago

3.1.37

2 years ago

3.1.39

2 years ago

3.1.50

2 years ago

3.1.52

2 years ago

3.1.51

2 years ago

3.1.32

2 years ago

3.1.31

2 years ago

3.1.45

2 years ago

3.1.44

2 years ago

3.1.46

2 years ago

3.1.49

2 years ago

3.1.48

2 years ago

3.1.41

2 years ago

3.1.40

2 years ago

3.1.43

2 years ago

3.1.42

2 years ago

3.1.30

2 years ago

3.1.29

2 years ago

3.1.28

2 years ago

3.1.25

2 years ago

3.1.24

2 years ago

3.1.27

2 years ago

3.1.26

2 years ago

3.1.23

2 years ago

3.1.22

2 years ago

3.1.14

2 years ago

3.1.15

2 years ago

3.1.18

2 years ago

3.1.17

2 years ago

3.1.19

2 years ago

3.1.21

2 years ago

3.1.20

2 years ago

3.1.12

2 years ago

3.1.11

2 years ago