title: AngularJS, connecting to a database
body: <p>I made a simple web page in angular JS with a list of phones, with a search query and sort by. 
  The information is stored in a .component.js file.
  I have a .template.html file and an index.html file as well as other AngularJS files.</p>
  
  <p>I have connected a database to my project, as instead of storing the data into a .component.js file, I want to display it through the database.</p>
  
  <p>How do I display information from a database via Angular? (I'm using IntelliJ).</p>
  
  <p>this is my .component.js file: ...</p>
  
  <pre><code>angular.
    module('phoneList').
     component('phoneList', {
      templateUrl: 'phone-list/phone-list.template.html',
      controller: function PhoneListController() {
    this.phones = [
      {
        name: 'Iphone 6S',
        rating: 3,
        maker: 'Apple'
      }, { 
  ...
  }
  ];
  this.orderProp = 'rating';
  }):
  </code></pre>
  
  <p>Do I have to completely change the whole layout of my project?</p>
  
  <p>I connected the database through MySQL and the database is phoneList, with one table: phones and columns Phone Name, Rating, Maker</p>