A service is a class for non-UI logic — data fetching, business rules, shared state, logging — that components can reuse. Dependency Injection (DI) is how Angular provides those services to the components that need them, instead of components creating them manually.
Defining a service
{ } ;
({ : })
{
users = [];
() { .; }
() { ..(u); }
}
