*Hi*

*please i try to use angular ui typeahead - i can get data and it works 
fine, but i try to refresh auto complete data after i add new client to 
database but it's not updated i don't know why that i call method that fill 
auto complete in add client on success *

    function getClient() {
        var getAllExtraFor = 
spacrudService.GET("/api/InvoiceMasterApi/GetClient");

        getAllExtraFor.then(function (data) {
            debugger;
            $scope.clients = data.data; // edit this line according to your 
api 
        },
            function (errorPl) {
                return;
            });
    };

*and in add client method i call getClient() again it's get the new data 
but not applied to autocomplete ??!*

    $scope.saveNewClient = function () {
        if ($scope.Invalid == false) {
            var appointmentToAdd = spacrudService.POST("/api/ClientsApi", 
$scope.NewClient);

            appointmentToAdd.then(function (data) {
                // Close Modal
                $("#ClientModal").modal("toggle");

                    toastr.success("Client Saved ...");

                $scope.NewClient = [];
                $scope.NewClient = { ClientName: "", DeleteRecStatus: 0 };


                getSupplier(); // i cal method here but autocomplete not 
updated

            },
                function (errorPl) {
                });
        }
    };

*auto complete html:*

                                <input type="text" style="text-align: 
right; border-bottom-left-radius: 4px; border-top-left-radius: 4px;"
                                       ng-model="BranchID"
                                       placeholder="Branch"
                                       uib-typeahead="b as b.BranchNameAr 
for b in branches  | filter:$viewValue | limitTo:8"
                                       class="form-control"
                                       typeahead-show-hint="true"
                                       typeahead-min-length="0"
                                       typeahead-editable="false"
                                       typeahead-on-select="onSelect($item)"
                                       ng-change="ClearSelection()"
                                       typeahead-no-results="noResults" />


*so please how can i make it works and make autocomplete updated ...?*

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to