<commit_before>'use strict';

/* Directives */


angular.module('odyssey.directives', []).
  directive('appVersion', ['version', function(version) {
    return function(scope, elm, attrs) {
      elm.text(version);
    };
  }]).
  directive('googleplace', ['currentCity', '$location', function(currentCity, $location) {
    return {
        link: function(scope, element, attrs) {
                    var options = {
                        types: ['(cities)'],
                        componentRestrictions: {}
                    };
                    scope.gPlace = new google.maps.places.Autocomplete(element[0], options);
                    google.maps.event.addListener(scope.gPlace, 'place_changed', function() {
    		                var place = scope.gPlace.getPlace();
                            console.log(place);
    		                var current_city = {
    		                 	name: place.name,
    		                	formatted_address: place.formatted_address,
    		                	location: {
    		                		lat: place.geometry.location.lb,
    		                		lng: place.geometry.location.mb
    		                	}
    		                }
    		                currentCity.setProperty(current_city);


                        var form = document.createElement("form");
                        form.setAttribute("method", "post");
                        form.setAttribute("action", "/trips");

                        var hiddenField = document.createElement("input");
                        hiddenField.setAttribute("type", "hidden");
                        hiddenField.setAttribute("name", "trip[name]");
                        hiddenField.setAttribute("value", place.name);
                        form.appendChild(hiddenField);

                        var hiddenField = document.createElement("input");
                        hiddenField.setAttribute("type", "hidden");
                        hiddenField.setAttribute("name", "trip[current_lat]");
                        hiddenField.setAttribute("value", place.geometry.location.lb);
                        form.appendChild(hiddenField);

                        var hiddenField = document.createElement("input");
                        hiddenField.setAttribute("type", "hidden");
                        hiddenField.setAttribute("name", "trip[current_lng]");
                        hiddenField.setAttribute("value", place.geometry.location.mb);
                        form.appendChild(hiddenField);

                        var hiddenField = document.createElement("input");
                        hiddenField.setAttribute("type", "hidden");
                        hiddenField.setAttribute("name", "formatted_address");
                        hiddenField.setAttribute("value", place.formatted_address);
                        form.appendChild(hiddenField);

                        document.body.appendChild(form);
                        form.submit();

    		            });
                }
<commit_msg>finally fixed the googlemaps changing lat and lng variable names bug<commit_after>'use strict';

/* Directives */


angular.module('odyssey.directives', []).
  directive('appVersion', ['version', function(version) {
    return function(scope, elm, attrs) {
      elm.text(version);
    };
  }]).
  directive('googleplace', ['currentCity', '$location', function(currentCity, $location) {
    return {
        link: function(scope, element, attrs) {
                    var options = {
                        types: ['(cities)'],
                        componentRestrictions: {}
                    };
                    scope.gPlace = new google.maps.places.Autocomplete(element[0], options);
                    google.maps.event.addListener(scope.gPlace, 'place_changed', function() {
    		                var place = scope.gPlace.getPlace();
                            console.log(place);
                            console.log(place.geometry.location.lat());
    		                var current_city = {
    		                 	name: place.name,
    		                	formatted_address: place.formatted_address,
    		                	location: {
    		                		lat: place.geometry.location.lat(),
    		                		lng: place.geometry.location.lng()
    		                	}
    		                }
    		                currentCity.setProperty(current_city);


                        var form = document.createElement("form");
                        form.setAttribute("method", "post");
                        form.setAttribute("action", "/trips");

                        var hiddenField = document.createElement("input");
                        hiddenField.setAttribute("type", "hidden");
                        hiddenField.setAttribute("name", "trip[name]");
                        hiddenField.setAttribute("value", place.name);
                        form.appendChild(hiddenField);

                        var hiddenField = document.createElement("input");
                        hiddenField.setAttribute("type", "hidden");
                        hiddenField.setAttribute("name", "trip[current_lat]");
                        hiddenField.setAttribute("value", place.geometry.location.lat());
                        form.appendChild(hiddenField);

                        var hiddenField = document.createElement("input");
                        hiddenField.setAttribute("type", "hidden");
                        hiddenField.setAttribute("name", "trip[current_lng]");
                        hiddenField.setAttribute("value", place.geometry.location.lng());
                        form.appendChild(hiddenField);

                        var hiddenField = document.createElement("input");
                        hiddenField.setAttribute("type", "hidden");
                        hiddenField.setAttribute("name", "formatted_address");
                        hiddenField.setAttribute("value", place.formatted_address);
                        form.appendChild(hiddenField);

                        document.body.appendChild(form);
                        form.submit();

    		            });
                }

{'fraction_non_alphanumeric': 0.11294765840220386, 'fraction_numerical': 0.00032409658078107277, 'mean_word_length': 1.4222919937205651, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6886039', 'n_tokens_mistral': 1432, 'n_tokens_neox': 1337, 'n_words': 209}