How to change the value of button on click of a dropdown list using angularjs
<div class="btn-group" style="margin-top:52px">
<button type="button" ng-model="dropdown" class="btn btn-primary">{{ddn}}</button>
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown"></button>
<div class="dropdown-menu" ng-repeat="ddl in ddList">
<a class="dropdown-item" ng-click="changeValue(parameter)" href="#">{{ddList[0].Parameter}}</a>
<a class="dropdown-item" ng-click="changeValue(parameter)" href="#">{{ddList[1].Parameter}}</a>
<a class="dropdown-item" ng-click="changeValue(parameter)" href="#">{{ddList[2].Parameter}}</a>
</div>
</div>
$scope.ddList = null;
$http.get(apiUrl + "/api/Warehouse/getDropdownList")
.then(function (response) {
$scope.ddList = JSON.parse(response.data);
$scope.parameter = $scope.ddList[0].Parameter;
})
$scope.ddn = null;
$scope.changeValue = function (parameter) {
$scope.ddn = $scope.parameter;
}