I'm new to Angular and this is my first major hurdle. I have the following JSON object returned from a third-party API of address data that's been added to $scope.AddressData in a controller:
$scope.AddressData = [{
"Address1":"South Row",
"Address2":"Horsforth",
"Address3":null,
"Address4":null,
"Town":"Leeds",
"County":"West Yorkshire",
"Postcode":"LS18 4AA",
"PremiseData":"12;||13;||14;"
}];
As you can see, I have multiple premises for one street. What I want to achieve is to have a select box that has one line per PremiseData item with the other fields appended to it.
Given the example above, I want the HTML to be:
<select name="premises">
<option value="12 South Row, Horsforth, Leeds, West Yorkshire"></option>
<option value="13 South Row, Horsforth, Leeds, West Yorkshire"></option>
<option value="14 South Row, Horsforth, Leeds, West Yorkshire"></option>
</select>
Also, once an item is selected, I want to populate other inputs with the relevant data.
Can anyone point me in the right direction?
;||and create an object for each one based on that.