My current task involves extracting the URL from the selected option and assigning it to the ng-model of the select element.
Here is the HTML code snippet:
<select ng-model="ddValue1.value">
<option ng-repeat="d in ddOptions1" value="{{d.value}}">{{d.text}}</option>
</select>
And here is some JS code:
$scope.ddOptions2 = [
{value: 'value1', text: 'Text1', url: 'google.com'},
{value: 'value2', text: 'Text2', url: 'yahoo.com'}
];
$scope.ddValue2 = {};
$scope.ddValue2.value = $scope.ddOptions2[0].value;
I attempted to assign the URL by using the following syntax: ng-model="ddValue1.url=d.url"