Fetching Data from MySQL using AngularJS $http

i know this question has been asked quite often but i can’t seem to find answer that solve my problem.
I’m just trying to fetch data unsing AngularJS from a PHP mySQL database (WAMP)
I’ve managed to get data with raw PHP/html from it, but i can’t manage to do it with AngularJS.I Follow this tutorial : https://www.w3schools.com/angular/angular_sql.asp (first code from each category.
Here is customer_mysql.php

header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");

    $bdd = new PDO('mysql:host=localhost;dbname=test;charset=utf8', 'root', '');
  catch(Exception $e)
          die('Erreur : '.$e->getMessage());
  return $bdd;
$result = $bdd->query("SELECT id, password, username FROM user_base");

$outp = "";
  while($rs = $result->fetch()) {
    if ($outp != "") {$outp .= ",";}
    $outp .= '{"Name":"'  . $rs["id"] . '",';
    $outp .= '"City":"'   . $rs["password"]        . '",';
    $outp .= '"Country":"'. $rs["username"]     . '"}';
$outp ='{"records":['.$outp.']}';


And here is my index.php page :

<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link href='http://fonts.googleapis.com/css?family=Roboto'>

  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>

  <div ng-app="myApp" ng-controller="customersCtrl">


    <div ng-app="myApp" ng-controller="customersCtrl">

      <tr ng-repeat="x in names">
        <td>{{ x.Name }}</td>
        <td>{{ x.Country }}</td>


var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
   .then(function (response) {$scope.names = response.data.records;});

Only thing i changed is the protocol (PDO, but as said worked with raw PHP) and the columns name.
I’ve changed the while loop fetching data condition to the one i used in php, but i admit i have about no idea of what is going on in there.
This looks pretty basic, but i’ve spent quite some time trying to fix this without any success.. Thanks for help

Source: AngularJS