Skip to content

$watch for text input change #19

@kavuri

Description

@kavuri

To keep track of the changes to the Places search in the input box, I am using $watch on the ng-model. In the $watch function, I am assigning the longitude and latitude as:

$scope.map.center.latitude = $scope.mapdetails.geometry['k'];
$scope.map.center.longitude = $scope.mapdetails.geometry['A'];

If I do not check on the validity of mapdetails, I get a 'undefined' error. But I realized that even if I select an item from the autocomplete list, I still see that 'mapdetails' is returned as empty. So, I am never able to retrieve the results in the $watch function.
What would be the proper way to act after an item is selected from the dropdown autocomplete list? I have tried using ng-change too, but the same result

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions