title: angularjs Scope is losing value?
body: <p>I have a form that intakes an address along with some other data.  I would like to send the address through google geocode for lat and long. then pass all the data into my db. So I can perform all the actions on their own and everything works. BUT when I tried to combine everything $scope.data.address returns undefined. Thank you for any help you can provide a noob.</p>
  
  <pre><code>  var date = new Date();
      $scope.date = $filter('date')(new Date(), 'MMMM dd, yyyy');
  
       $scope.data = {     
          date:        $scope.date,  
          claim:       $scope.claim,
          name:        $scope.name,
          address:     $scope.address,
          notes:       $scope.notes
        };
  
  
  
      $scope.addClaim = function () {
  
         // get address from input form and covert to latitude longitude
          geocoder = new google.maps.Geocoder();
          if (geocoder) {
              geocoder.geocode({
                  'address': $scope.data.address
              }, function (results, status) {
                  if (status == google.maps.GeocoderStatus.OK) {
                      $scope.lat = results[0].geometry.location.lat();
                      $scope.long = results[0].geometry.location.lng();
                      console.log($scope.data.address)
                      console.log('lat' + results[0].geometry.location.lat())
                      console.log('long' + results[0].geometry.location.lng())
  
  
          // push new record to firebase
          firebase.database().ref('/claim/').push({
  
             date:        $scope.data.date,
             claim:       $scope.data.claim,
             name:        $scope.data.name,
             address:     $scope.data.address,
             notes:       $scope.data.notes,
             lat:         $scope.lat,
             long:        $scope.long
  
  
          });
          // end firebase
                  }
              });
          }
         // end convert address
  </code></pre>