1. What is a service in Angular and how is it injected?
A service holds reusable business logic or data access and is provided through Angular’s Dependency Injection (DI). Mark the class with @Injectable and provide it (preferably `providedIn: 'root'`). Consumers request it in a constructor or via `inject()` so Angular hands back a singleton instance for that injector scope.
@Injectable({ providedIn: 'root' })
export class DataService { constructor(private http: HttpClient) {} getUsers(){ return this.http.get('/api/users'); } }
@Component({...})
export class UsersComponent { constructor(private data: DataService) {} }