I am trying to use jQuery Geocomplete with my AngularJS application.
I have this in my html page.
<input id="destination-location-input" type="text" class="form-control"
ng-model="destCtrl.destination" ng-change="destCtrl.locationChanged()"
data-geocomplete="street address" required/>
and added this code in controller.
var myElement = angular.element( document.querySelector('#destination-location-input'));
myElement.geocomplete(
{
appendToParent: true,
onChange: function(name, result) {
var location = result.geometry.location;
},
onNoResult: function(name) {
console.log("Could not find a result for " + name)
}
});
When run my app, I am getting this error.
TypeError: myElement.geocomplete is not a function
What could be the issue?