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.
15.0.1 (2022-11-22)
common
| Commit | Type | Description |
| -- | -- | -- |
| 930af9dd26 | fix | Fix MockPlatformLocation events and missing onPopState implementation (#48113) |
forms
| Commit | Type | Description |
| -- | -- | -- |
| b342e55509 | fix | don't mutate validators array (#47830) |
| a12a120272 | fix | FormBuilder.group return right type with shorthand parameters. (#48084) |
language-service
| Commit | Type | Description |
| -- | -- | -- |
| cc8b76ef7c | fix | correctly handle host directive inputs/outputs (#48147) |
| a8c33bf931 | fix | update packages/language-service/build.sh script to work with vscode-ng-language-service's new Bazel build (#48120) |
router
| Commit | Type | Description |
| -- | -- | -- |
| e4309d57d8 | fix | correct type of nextState parameter in canDeactivate (#48038) |
| 9baefd085f | fix | Ensure renavigating in component init works with enabledBlocking (#48063) |
| fa5528fb5f | fix | restore 'history.state' on popstate even if navigationId missing (#48033) |
Special Thanks
Alan Agius, Andrew Scott, Bjarki, Bob Watson, Brooke, Derek Cormier, Dylan Hunn, George Kalpakas, Greg Magolan, Ikko Ashimine, Ivan Rodriguez, Jessica Janiuk, Joe Roxbury, Joey Perrott, Kristiyan Kostadinov, Matthieu Riegler, Mikhail Savchuk, Nebojsa Cvetkovic, Pawel Kozlowski, Volodymyr and Wooshaah
<!-- CHANGELOG SPLIT MARKER -->
<a name="12.2.17"></a>