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.1.0-next.1 (2024-12-04)
compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| f280467398 | fix | account for multiple generated namespace imports in HMR (#58924) |
core
| Commit | Type | Description |
| -- | -- | -- |
| e894a5daea | feat | set kind field on template and effect nodes (#58865) |
| 3b765367f3 | fix | Explicitly manage TracingSnapshot lifecycle and dispose of it once it's been used. (#58929) |
migrations
| Commit | Type | Description |
| -- | -- | -- |
| e31e52e177 | fix | class content being deleted in some edge cases (#58959) |
| 508d3a1b3b | fix | correctly strip away parameters surrounded by comments in inject migration (#58959) |
| 7191aa6e09 | fix | don't migrate classes with parameters that can't be injected (#58959) |
| a4924af6d5 | fix | inject migration aggressively removing imports (#58959) |
| 35165d152d | fix | inject migration dropping code if everything except super is removed (#58959) |
| 68e5ba7a3a | fix | preserve type literals and tuples in inject migrations (#58959) |
platform-server
| Commit | Type | Description |
| -- | -- | -- |
| 1cfbfc66d3 | fix | remove peer dependency on animations (#58997) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="19.0.2"></a>