In my application, I have a pop-up that includes a multi-select dropdown menu.
Here is the code for the Multi-Select Dropdown:
<select name="edit_tags" class="form-control" id="advisor_article_tagsx" multiple=""
required ng-model="article_selected" ng-options="article_service as article_service.name for article_service in article_services">
</select>
The article_services
array is used in the multi-select dropdown, and it is fetched using the following code:
$http.get(url + 'service_provided').
then(function (response) {
$scope.article_services = response.data.service_provided;
});
When clicking on the Edit Button with
ng-click="advisor_article_edit()"
, I want the pop-up to open with some pre-selected checkboxes in the multi-select dropdown.
However, despite trying to set the selection in the function below, it does not work as expected:
$scope.advisor_article_edit = function () {
// This should set the selection but it doesn't.
$scope.article_selected = [$scope.article_services[3]];
}