Instantiates autocomplete controller
Produces a function to be bound to an instance of Autocomplete.Interface
.
It executes suggestion search when address input is updated
Produces a function to be bound to an instance of Autocomplete.Interface
.
Populates fields with correct address when suggestion selected
Binds internal instanec of Autocomplete.Interface
to DOM and applies
necessary callbacks
Configures HTTP client options prior to instantiation
Detaches the autocomplete interaface from the DOM
Binds any optional callbacks supplied in configuration to controller or writes a NOOP if callback not provided
Produces an instance of IdealPostcodes.Client
This creates a new instance of Autocomplete.Interface
and attaches it to the DOM.
Furthermore, Checks if key is usable (if enabled)
This method is invoked upon the instantiation of Autocomplete.Controller
,
however it may be used to detach/re-attach new instances of the interface
Updates an internal list of CSS selectors which will direct the flow of addressing information when user selects an address
Writes a selected to the input fields specified in the controller config
Restrict autocomplete suggestions to certain features (e.g. post town, outward postcode)
Autocompete.Controller
The Autocomplete Controller class acts as the public class which you may wield to enable address autocomplete on your HTML address forms
When instantiated, the controller will serve as a bridge beteen the address suggestion interface presented on the DOM and the Ideal Postcodes Address resolution HTTP APIs
More concretely, the instantiation of a controller instance creates:
Autocomplete.Interface
The role of the controller is to bind to events produced by the user interface and take appropriate action including querying the API, modifying other aspects of the DOM.