concept api in category aurelia

appears as: n API, APIs
Aurelia in Action

This is an excerpt from Manning's book Aurelia in Action.

Having determined where you’re going to implement this logic, how do you go about doing it? One of the most popular choices in Aurelia is via the use of a service class (figure 1.11). There’s nothing special about a service class. In fact, it’s a plain old JavaScript object (or POJO). Service classes allow you to separate the concern of retrieving data from an API from the view-model concerns of getting data rendered to the screen. In this case, you’d fill out the logic for retrieving the data via AJAX (most likely via aurelia-fetch-client, an HTTP client that makes your life much simpler than the jQuery AJAX $.get method, but we’ll get into that in more detail later). An instance of this service class can be automatically injected into the view-model using dependency injection.