Hi bro
i am using bootstrap typeahead functionality for my search tab (auto
complete suggestions purpose) and we are loading data form database
My code is
html file:-
<input type="text" ng-model='locality' name="locality" typeahead="name for
locality in getLocality($viewValue)" typeahead-loading="loadingLocations"
class="form-control size1 input-medium search-query" placeholder="Enter
Organization name/service"></input>
app.js
$scope.getLocality = function(val){
// $scope.config(val);
console.log(val);
if($scope.locality.length <3){
return;
}
var url = $rootScope.baseURL +
'/api/location?locality='+$scope.locality;
console.log("within getLocality");
return $http({
method: 'GET',
url: url,
data: "",
timeout: 120000,
headers: { 'Content-Type': 'application/json' }
}).success(function (data, status, headers, config) {
$scope.localities=data.data;
return $scope.localities;
}).error(function (data, status, headers, config) {
console.log(data);
});
}
but it was not working properly
is there any mistakes in my code
can u please help me out of this problem
On Saturday, February 14, 2015 at 1:39:25 PM UTC+5:30, Sander Elias wrote:
>
> Hi Ercan,
>
> Have a look at this: http://plnkr.co/edit/VCS06QysGlDquXeh6FSg?p=preview
> I mean to recall that the syntax you used was deprecated, a long while
> ago, but my memory may fail me here.
>
> Regards
> Sander
>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" 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 http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.