Как получить доступ к свойствам выбранного элемента из ng-dropdown-multiselect?

Я использую angle's ng-dropdown-multiselect и вижу, что каждый раз, когда я выбираю элемент, в модель добавляется только его Id. Я хочу добавить выбранный элемент в список, для которого мне нужно получить доступ к другим его свойствам. Я что-то здесь не так делаю?

Dropdown: <div ng-dropdown-multiselect="" options="example9data" selected-model="example9model" extra-settings="example9settings" events="yourEvents"></div>
    <br/>
    Model: {{example9model}}

JS:

$scope.example9model = []; 
        $scope.example9data = [ {id: 1, label: "David"}, {id: 2, label: "John"}, {id: 3, label: "Danny"}]; 
        $scope.example9settings = {enableSearch: true, keyboardControls: true, clearSearchOnClose: true, template: '{{option.label}}',
        smartButtonTextConverter(skip, option) { return option.label; }};
        $scope.list = [];

        $scope.yourEvents = {
            onItemSelect: function(item) {
                     console.log(item);
                },
            onItemDeselect: function(item) {
                     console.log(item);
               }
        };

0 ответов

Другие вопросы по тегам