title: How to get json data from other domain?
body: <p>I am working in an Angular app. I need to get a Json from the following url:</p>
  
  <p><a href="http://www.citibikenyc.com/stations/json" rel="nofollow">http://www.citibikenyc.com/stations/json</a></p>
  
  <p>I tried using <code>$http.get()</code> and <code>$http.jsonp()</code></p>
  
  <p>When I do the following</p>
  
  <pre><code>$http.get("http://www.citibikenyc.com/stations/json")
          .then(function (response) {
             console.log(response.data);
          });
  </code></pre>
  
  <p>I am getting the following error :</p>
  
  <pre><code>XMLHttpRequest cannot load [url that i use here]. 
  No 'Access-Control-Allow-Origin' header is present on the requested resource. 
  Origin 'http://localhost' is therefore not allowed access.
  </code></pre>
  
  <p>When I do the following code:</p>
  
  <pre><code>$http.jsonp("http://www.citibikenyc.com/stations/json?callback=JSON_CALLBACK")
         .then(function (response) {
            console.log(response.data);
         });
  </code></pre>
  
  <p>I am getting <code>SyntaxError: Unexpected token :</code></p>