> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/angular/angular/llms.txt
> Use this file to discover all available pages before exploring further.

# Core API Overview

> Overview of Angular Core APIs for building components, directives, and services

## Introduction

The Angular Core API provides the fundamental building blocks for creating Angular applications. This module contains decorators, functions, and interfaces that enable component creation, dependency injection, lifecycle management, and reactive data handling.

## Key Concepts

### Decorators

Angular uses TypeScript decorators to add metadata to classes and class members:

* **@Component** - Defines a component with template and styles
* **@Directive** - Creates reusable behaviors for DOM elements
* **@Injectable** - Marks a class as available for dependency injection
* **@Input** - Declares input properties for data binding
* **@Output** - Declares output properties for event emission

### Components and Directives

Components are the basic UI building blocks of Angular applications. They combine:

* A TypeScript class with application logic
* An HTML template that defines the view
* CSS styles for appearance
* Metadata that tells Angular how to process the class

Directives extend HTML by attaching custom behavior to DOM elements.

### Dependency Injection

Angular's dependency injection system allows you to declare dependencies in class constructors. The framework automatically provides instances when needed, promoting loose coupling and testability.

### Lifecycle Hooks

Components and directives have lifecycle hooks that provide visibility into key moments:

* Initialization (`OnInit`)
* Change detection (`OnChanges`, `DoCheck`)
* View and content queries (`AfterViewInit`, `AfterContentInit`)
* Cleanup (`OnDestroy`)

## API Categories

<CardGroup cols={2}>
  <Card title="Component" icon="cube" href="/api/core/component">
    Define components with templates and styling
  </Card>

  <Card title="Directive" icon="wand-magic-sparkles" href="/api/core/directive">
    Create reusable DOM behaviors
  </Card>

  <Card title="Injectable" icon="syringe" href="/api/core/injectable">
    Enable dependency injection for services
  </Card>

  <Card title="Input & Output" icon="right-left" href="/api/core/input-output">
    Define component communication interfaces
  </Card>

  <Card title="Lifecycle Hooks" icon="arrows-spin" href="/api/core/lifecycle-hooks">
    React to component lifecycle events
  </Card>
</CardGroup>

## Common Imports

```typescript theme={null}
import {
  Component,
  Directive,
  Injectable,
  Input,
  Output,
  OnInit,
  OnDestroy,
  EventEmitter
} from '@angular/core';
```

## Standalone Components

Starting with Angular 14, components can be standalone, eliminating the need for NgModules:

```typescript theme={null}
@Component({
  selector: 'app-hello',
  standalone: true,
  template: '<h1>Hello {{name}}</h1>'
})
export class HelloComponent {
  name = 'World';
}
```

## Signal-Based APIs

Angular 16+ introduces signal-based reactivity:

* `input()` - Signal-based input properties
* `output()` - Signal-based output properties
* `computed()` - Derived reactive values
* `effect()` - Side effects based on signal changes

## Related Resources

<CardGroup cols={2}>
  <Card title="Components Guide" icon="book" href="/concepts/components">
    Learn how to build components
  </Card>

  <Card title="Dependency Injection" icon="book" href="/concepts/dependency-injection">
    Master Angular's DI system
  </Card>
</CardGroup>
