Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

ngModel not working in multiple with ajax. #288

Open
arjundas opened this issue Feb 18, 2015 · 0 comments
Open

ngModel not working in multiple with ajax. #288

arjundas opened this issue Feb 18, 2015 · 0 comments

Comments

@arjundas
Copy link

here is my view code :

<div multiple ui-select2="select2Options" id="qwe" ng-model='variable1' name="" class="text" placeholder="Placeholder Text"></div>

and in controller :

app.controller('someCtrl', function($scope, $stateParams, $http, $location, $rootScope, $url,  $compile, $tableService){

        $scope.variable1 = [];

        var lastResults = [];

        $scope.select2Options = {
            allowClear : true,
            ajax : {
                url: 'someUrl',
                dataType: "json",
                type: "POST",
                quietMillis: 500,
                data: function(term, page) {
                    return {
                        json: JSON.stringify(lastResults),
                        page_limit: 10,
                        page: page,
                        str: term
                    };
                },
                results: function(data, page) {
                    var more = data.to < data.total;
                    return {results: data.data, more: more};
                }
            }
        };
    });

but variable1 is not update on select of any tag.
This is worked without multiple but not worked with multiple.
any help please?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant