title: Limit google autocomplete to a postal code
body: <p>Trying to work with the Google Autocomplete without maps, but it's being troublesome.</p>
  
  <pre><code>&lt;script&gt;
    var autocomplete;
    var countryRestrict = {country: 'NO', postalCode: '0365'}
    function initAutocomplete() {
      autocomplete = new google.maps.places.Autocomplete(
        (document.getElementById('address-field')),
        { types: ['address'],
          componentRestrictions: countryRestrict
        });
    }
  &lt;/script&gt;
  &lt;script src="https://maps.googleapis.com/maps/api/js?key=API-KEY&amp;libraries=places&amp;callback=initAutocomplete"
          async defer&gt;&lt;/script&gt;
  </code></pre>
  
  <p>when I add <code>postalCode</code>to countryRestrict it stops working, yet I see in their own example that they seem to be restricting it by using the example:</p>
  
  <pre><code>componentRestrictions: {country: "AU", postalCode: "2000"}
  </code></pre>
  
  <p><a href="https://developers.google.com/maps/documentation/javascript/examples/geocoding-component-restriction" rel="nofollow">https://developers.google.com/maps/documentation/javascript/examples/geocoding-component-restriction</a></p>
  
  <p>Is it possible for me to limit the address autocomplete to a given postal code?</p>