Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Variables

Functions

Variables

Const controllers

controllers: Controller[] = []

Caches all instances of the plugin created via setup

Functions

Const setup

  • Creates Postcode lookup field and button when called on

    First argument context is a query selector string which designates where on the DOM the plugin will be instantiated

    Second argument config allows for advanced configuration of the plugin

    When invoked, an instance of the Postcode Lookup controller is stored in contollers

    Returns an instance of Postcode Lookup controller unless checkKey: true. If key checking is enabled, controller can be accessed by the onLoaded callback

    example
    PostcodeLookup.setup({
      context: "#container",
      apiKey: "foo",
      output_fields: {
        line_1: "#address_line_1",
        line_2: "#address_line_2",
        line_3: "#address_line_3",
        post_town: "#post_town",
        postcode: "#postcode",
      }
    });
    

    Parameters

    Returns Controller