What is @angular/core?
The @angular/core package is a fundamental part of Angular, a popular front-end web application platform. It provides the critical runtime parts of the Angular framework, including the component decorator, directives, dependency injection, and the core Angular APIs necessary for building dynamic single-page web applications.
What are @angular/core's main functionalities?
Components
Components are the building blocks of Angular applications. They control a patch of screen called a view. The @Component decorator indicates that the class immediately below it is a component and provides metadata about the component.
"@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'My Angular App'; }"
Dependency Injection
Dependency Injection (DI) is a design pattern used in Angular to make components or classes dependent on interfaces rather than concrete implementations. This improves modularity and testability.
"constructor(private myService: MyService) {}"
Directives
Directives are classes that add additional behavior to elements in your Angular applications. With Angular's built-in directives, you can manage forms, lists, styles, and what users see.
"@Directive({ selector: '[appHighlight]' }) export class HighlightDirective { constructor(el: ElementRef) { el.nativeElement.style.backgroundColor = 'yellow'; } }"
Other packages similar to @angular/core
react
React is a popular JavaScript library for building user interfaces. It focuses on a component-based architecture similar to Angular but uses a different syntax and design philosophy. React emphasizes a one-way data flow and virtual DOM for efficient rendering.
vue
Vue.js is a progressive JavaScript framework used for building UIs and single-page applications. It is designed from the ground up to be incrementally adoptable. Vue also focuses on the ViewModel part of the MVVM pattern and employs a reactive and composable data model.
19.0.0-rc.0 (2024-10-30)
compiler
| Commit | Type | Description |
| -- | -- | -- |
| 98804fd4beb | fix | add more specific matcher for hydrate never block (#58360) |
compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| dbe612f2cd5 | fix | disable standalone by default on older versions of Angular (#58405) |
core
| Commit | Type | Description |
| -- | -- | -- |
| c095679f927 | fix | avoid breaking change with apps using rxjs 6.x (#58341) |
| fd7716440be | fix | Prevents trying to trigger incremental hydration on CSR (#58366) |
localize
| Commit | Type | Description |
| -- | -- | -- |
| 0730d9d748a | fix | Adding arb format to the list of valid formats in the localization extractor cli (#58287) |
migrations
| Commit | Type | Description |
| -- | -- | -- |
| 90c7ec39a06 | fix | inject migration always inserting generated variables before super call (#58393) |
| 7a65cdd911c | fix | inject migration not inserting generated code after super call in some cases (#58393) |
| 616b411a6d9 | fix | properly migrate output aliases (#58411) |
| d504452e2f1 | fix | properly replace imports across files (#58414) |
router
| Commit | Type | Description |
| -- | -- | -- |
| a49c35ec769 | fix | remove setter for injector
on OutletContext
(#58343) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="18.2.10"></a>