Ionic http post to external url
<p>Im trying to send a post to a url with Ionic using angular, but i have the response:</p>

<blockquote>
  <p>Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://localhost:8100" rel="noreferrer">http://localhost:8100</a>' is therefore not allowed access. The response had HTTP status code 404.</p>
</blockquote>

<p>I know that the external service is working, because i tested it by ajax and everything works perfectly...</p>

<p>Below the code used in AngularJS (Ionic) and Ajax:</p>

<p>Ionic:</p>

<pre><code>var loginServiceUrl = 'http://url.com.br'; //It is not the real one
var loginServiceData = {
    email: email@email.com.br
    senha: 1234
};
$http.post(loginServiceUrl, loginServiceData).
then(function (res){
    console.log(res);
});
</code></pre>

<p>Ajax:</p>

<pre><code>$.ajax({
    type: "POST",
    url : 'http://url.com.br', //It is not the real one
    data : {email: 'email@email.com.br', senha: '1234'},
    success: function(result) {
        $('html').text(JSON.stringify(result));
    }
});
</code></pre>

<p>Does anyone know why I get the post via ajax on my localhost and not with the ionic, also localhost?</p>