Angular: Commonly used imports from @angular/core module

Core Module Imports

  1. Decorators:

    • Component

    • Directive

    • Pipe

    • Injectable

    • NgModule

  2. Lifecycle Hooks:

    • OnInit

    • OnDestroy

    • OnChanges

    • AfterViewInit

    • AfterViewChecked

    • AfterContentInit

    • AfterContentChecked

  3. Dependency Injection:

    • Inject

    • Optional

    • Self

    • SkipSelf

    • Host

  4. Change Detection and Rendering:

    • ChangeDetectionStrategy

    • ChangeDetectorRef

  5. Event and DOM:

    • ElementRef

    • Renderer2

    • TemplateRef

    • ViewContainerRef

  6. Other Useful Features:

    • Input

    • Output

    • HostBinding

    • HostListener

    • ContentChild

    • ContentChildren

    • ViewChild

    • ViewChildren

Platform Utilities

  • enableProdMode

  • PLATFORM_ID

  • isPlatformBrowser

  • isPlatformServer

Application State:

  • ApplicationRef

  • NgZone

Error Handling:

  • ErrorHandler

An unhandled error has occurred. Reload 🗙