I suppose this is more of a UI-Bootstrap question, but I am using it in the context of an Angular app.
Error message:
" Cannot read property ‘length’ of undefined"
I have followed the tutorial on their site to no avail. Here is my code.
$scope.newSearch = function(query) {
return $http.get(apiURL + "/search.json?" + apiKey + "&api_username=" + $rootScope.user.user.username + "&term=" + query, {
}).then(function(response){
$rootScope.$broadcast('search', response);
});
};
Im not actually using it to populate values in a tooltip, im simply broadcasting the event and passing the data along with it to update a view.
My search overlay is inside a directive, so maybe that is contributing to the the error. It is working as expected although I notice that when I console.log() the reponse, it is always one character behind what I have actually typed. Thanks a bunch.
EDIT: I’m simply firing my search function on ng-keydown, so this is SOLVED. Thanks.
-C