angular-google-places-autocomplete
angular-google-places-autocomplete copied to clipboard
Cleanup drawer element when gPlacesAutocomplete $destroy occurs
Inside the gPlacesAutocomplete
init code, the drawer element is appended to body: https://github.com/kuhnza/angular-google-places-autocomplete/blob/master/src/autocomplete.js#L88
However, upon $destroy
of the gPlacesAutocomplete
element, there should be cleanup logic to remove that element from <body>
via element.remove()
.
The code should be updated as such:
function initAutocompleteDrawer() {
// existing code...
scope.$on('$destroy', function() {
$drawer.remove();
});
}
scope
needs to be $scope
then +1 confirm this fixes #42