title: Google places autocomplete shows error in console in angularjs?
body: <p>I am using angularjs version 1.13.X.In my app there is a google places autocomplete search box as a directive.When loading the page following error showing in the console, but search box works fine.</p>
  
  <pre><code>InvalidValueError: setComponentRestrictions: in property country: not a string; and not an Array
  </code></pre>
  
  <p>My directive code </p>
  
  <pre><code>routerApp.directive('googleplace', ['$state', function ($state) {
              return {
                  require: 'ngModel',
                  link: function (scope, element, attrs, model) {
                      var options = {
                          types: [],
                          componentRestrictions: {}
                          };
                      scope.gPlace = new google.maps.places.Autocomplete(element[0], options);
                      google.maps.event.addListener(scope.gPlace, 'place_changed', function (e) {
                          scope.$apply(function () {
                              model.$setViewValue(element.val());
                              var countrycode = "na";
                              var latitude = 0;
                              var longitude = 0;
                              scope.secondplacebox = scope.chosenPlace;
                              for (var i = 0; i &lt; scope.gPlace.getPlace().address_components.length; i++) {
                                  if (scope.gPlace.getPlace().address_components[i].types[0] == 'country') {
                                      countrycode = scope.gPlace.getPlace().address_components[i].short_name;
                                  }
                              }
                              latitude = scope.gPlace.getPlace().geometry.location.lat().toFixed(6);
                              longitude = scope.gPlace.getPlace().geometry.location.lng().toFixed(6);
                              //$state.go('home');
                              scope.Fn_setCookieData(latitude, longitude, countrycode);
  
                          });
                      });
                  }
              };
          }
      ]);
  </code></pre>
  
  <p>How to solve this issue ? Please help me and thanks in advance</p>