title: angularjs call to an external url with $http.get
body: <p>I have a problem with angular and calls to an external json, the fact is that local works perfectly, but when I make the call with a full url gives me 404, I leave the code in case you see something missing, thanks:</p>
  
  <pre><code>// JavaScript Document
  var angularTodo = angular.module('lostsysApp', []);
  
  function mainController($scope, $http) {
      $scope.names = [];
  
      $http.get('http://www.viudadesoubrier.com/angular/model.php')
          .success(function(data) {
              $scope.names = eval(data);
              console.log(data)
          })
          .error(function(data) {
              alert(data);
              console.log('Error: ' + data);
          });
  
      $scope.addNom = function() {
          $http.post('http://www.viudadesoubrier.com/angular/model.php', { op: 'append', nom: $scope.nom, telefon: $scope.telefon } )
              .success(function(data) {
                  $scope.names = eval(data);
                  console.log(data)
              })
              .error(function(data) {
                  console.log('Error: ' + data);
              });
  
          $scope.nom="";
          $scope.telefon="";
      }
  
      $scope.delNom = function( nom ) {
          if ( confirm("Seguro?") ) {
              $http.post('http://www.viudadesoubrier.com/angular/model.php', { op: 'delete', nom: nom } )
                  .success(function(data) {
                      $scope.names = eval(data);
                      console.log(data)
                  })
                  .error(function(data) {
                      console.log('Error: ' + data);
                  });
          }
      }
  }
  </code></pre>
  
  <p>Add the code of index.html</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html ng-app="lostsysApp"&gt;
      &lt;head&gt;
          &lt;meta charset="UTF-8"&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  
          &lt;link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"&gt;
          &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.11/angular.min.js"&gt;&lt;/script&gt;
          &lt;script src="app.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body ng-controller="mainController"&gt;
          &lt;div class="jumbotron text-center"&gt;
              &lt;h1&gt;Angular Test&lt;/h1&gt;
          &lt;/div&gt;
          &lt;div class="col-sm-8 col-sm-offset-2 text-center"&gt;
              &lt;div class="form-group"&gt;
                  &lt;input type="text" ng-model="nom" placeholder="Contact Name" class="form-control input-lg text-center" /&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;input type="text" ng-model="telefon" placeholder="Phone Number" class="form-control input-lg text-center" /&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;button class="btn btn-primary btn-lg" ng-click="addNom()"&gt;Añadir&lt;/button&gt;
              &lt;/div&gt;
  
              &lt;div ng-repeat="n in names"&gt;
                  &lt;p&gt;
                      {{n.nom}} ({{n.phone}})
                      &lt;a href="#" ng-click="delNom(n.nom)"&gt;[X]&lt;/a&gt;
                  &lt;/p&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Thank you.</p>