Socket
Socket
Sign inDemoInstall

@angular/core

Package Overview
Dependencies
3
Maintainers
2
Versions
804
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @angular/core

Angular - the core framework


Version published
Weekly downloads
3.5M
increased by2%
Maintainers
2
Install size
24.3 MB
Created
Weekly downloads
 

Package description

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

Changelog

Source

18.0.0-next.6 (2024-04-25)

Breaking Changes

animations

  • Deprecated matchesElement method has been removed from AnimationDriver as it is unused.

core

  • async has been removed, use waitForAsync instead.

http

  • By default we now prevent caching of HTTP requests that require authorization . To opt-out from this behaviour use the includeRequestsWithAuthHeaders option in withHttpTransferCache.

    Example:

    withHttpTransferCache({
      includeRequestsWithAuthHeaders: true,
    })
    

platform-browser

  • Deprecated StateKey, TransferState and makeStateKey have been removed from @angular/platform-browser, use the same APIs from @angular/core.

Deprecations

common

  • getCurrencySymbol, getLocaleCurrencyCode, getLocaleCurrencyName, getLocaleCurrencySymbol, getLocaleDateFormat, getLocaleDateTimeFormat, getLocaleDayNames, getLocaleDayPeriods, getLocaleDirection, getLocaleEraNames, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleFirstDayOfWeek, getLocaleId, getLocaleMonthNames, getLocaleNumberFormat, getLocaleNumberSymbol, getLocalePluralCase, getLocaleTimeFormat, getLocaleWeekEndRange, getNumberOfCurrencyDigits

http

  • HttpClientModule, HttpClientXsrfModule and HttpClientJsonpModule

    As mentionned, those modules can be replaced by provider function only.

animations

| Commit | Type | Description | | -- | -- | -- | | bcce85af72 | refactor | remove deprecated matchesElement from AnimationDriver (#55479) |

common

| Commit | Type | Description | | -- | -- | -- | | d34c033902 | refactor | Deprecate Local Data API functions (#54483) |

compiler-cli

| Commit | Type | Description | | -- | -- | -- | | 7a16d7e969 | fix | don't type check the bodies of control flow nodes in basic mode (#55360) |

core

| Commit | Type | Description | | -- | -- | -- | | a730f09ae9 | feat | Add a public API to establish events to be replayed and an attribute to mark an element with an event handler. (#55356) | | 5f06ca8f55 | feat | add HOST_TAG_NAME token (#54751) | | ac863ded48 | feat | provide ExperimentalPendingTasks API (#55487) | | 5a10f405d3 | fix | complete the removal of deprecation async function (#55491) | | c175bca364 | fix | DeferBlockFixture.render should not wait for stability (#55271) | | 9894278e71 | fix | make ActivatedRoute inject correct instance inside @defer blocks (#55374) | | 5948193e13 | fix | skip defer timers on the server (#55480) |

http

| Commit | Type | Description | | -- | -- | -- | | 6f88d80758 | feat | allow caching requests with different origins between server and client (#55274) | | 8eacb6e4b9 | feat | exclude caching for authenticated HTTP requests (#55034) | | ef665a40a5 | refactor | Deprecate HttpClientModule & related modules (#54020) |

migrations

| Commit | Type | Description | | -- | -- | -- | | f914f6a362 | feat | Migration schematics for HttpClientModule (#54020) |

platform-browser

| Commit | Type | Description | | -- | -- | -- | | cba336d4f1 | refactor | remove deprecated transfer state APIs (#55474) |

platform-server

| Commit | Type | Description | | -- | -- | -- | | 5674c644ab | fix | add nonce attribute to event record script (#55495) |

router

| Commit | Type | Description | | -- | -- | -- | | 4a42961393 | feat | withNavigationErrorHandler can convert errors to redirects (#55370) |

<!-- CHANGELOG SPLIT MARKER -->

<a name="17.3.6"></a>

Readme

Source

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

Usage information and reference details can be found in Angular documentation.

License: MIT

FAQs

Last updated on 25 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc