How do I display an array of entities from a controller? I am new on Drupal 8 , so i have created a service class which return a list of data, 'articles' (node entities), and I call this  service class inside a controller, but no data showing up :
My getArticles() method inside my service:
  public function getArticles(){
    $storage = \Drupal::service('entity_type.manager')-&gt;getStorage('node');
    $my_entity_ids = $storage-&gt;getQuery()
      -&gt;condition('type', 'article')
      -&gt;condition('status', 1)
      -&gt;execute();
    $my_entities = $storage-&gt;loadMultiple($my_entity_ids);
    return $my_entities;
  }

My controller:
public function myPage() {
    $data = \Drupal::service('mymodule.service');
    $dataService = $data-&gt;getArticles();
    return $dataService;
  }

My result is a blank white page when I view the path routed to my controller, but I see the following message in my error log:

Recoverable fatal error : Object of class Drupal\node\Entity\Node could not be converted to string dans Drupal\Component\Utility\Xss::filter()'' -----&quot;Warning : strlen() expects parameter 1 to be string, array given dans Drupal\Component\Utility\Unicode::validateUtf8()

Can anyone tell me please why i can't get the articles?
Controllers need to return a render array. Let's imagine you process your articles for render in a new method renderMyPage() which you call from myPage() and pass your array of article objects.
If you're displaying multiple fields from the articles, you're best off building and configuring a view mode and then getting the view mode render array as described in this answer.
function renderMyPage($articleObjects) {
  $view_builder = \Drupal::entityTypeManager()-&gt;getViewBuilder('node');

  $articles = [];
  foreach ($articleObjects as $article) {
    $articles[] = $view_builder-&gt;view($article, 'my_view_mode_machine_name');
  }

  return $articles;
}

If you want to render a single field from your article, you can get the render array for a field as described in this answer.
function renderMyPage($articleObjects) {
  $articles = [];
  foreach ($articleObjects as $article) {
    // You can pass a view_mode machine name or
    // an array of field configurations to view().
    $articles[] = $article-&gt;title-&gt;view();
  }

  return $articles;
}

Alternatively you can build your own render array, say to render the title as an h2.
function renderMyPage($articleObjects) {
  $articles = [];
  foreach ($articleObjects as $article) {
    $articles[] = [
      '#type' =&gt; 'html_tag',
      '#html_tag' =&gt; 'h2',
      '#value' =&gt; $article-&gt;title-&gt;value,
      // The other methods add cache tags automatically, but we need to add
      // cache tags manually here since we're building the array from scratch.
      '#cache' =&gt; [
        'tags' =&gt; $article-&gt;getCacheTags(),
      ],
    ];
  }

  return $articles;
}

Each of these examples returns an $articles array of renderable contents suitable as a return value from your myPage() method.