Skip to content

Implementing best practices of Angular: APP_INITIALIZER , HTTP_INTERCEPTORS , Custom Error Handling, Content Projection, TemplateRef's & ViewContainerRef for creating reusable templates and Custom Structural Directives , SCAM ,SOLID, TDD, Lazy Loading, Dependency Injection Injection Tokens, useValue, useFactory

Notifications You must be signed in to change notification settings

sgarg5858/angular-practice-project

Repository files navigation

  1. APP_INTITIALIZER

Built-in Injection Token which we can use to load some data before Angular Starts bootstrapping our application. It expects functions and those functions can either return value or Promise or Observable It will wait for promises to resolve & observables to complete & error out, We can provide multiple functions and it will wait until our functions have executed , if every function is completed successfully, then only it will start with bootstrapping process, else it will cancel the bootstrap.

We usually store our END points in environment files, but drawback is that we can't change them at runtime, but if we store them in database we can make changes to them at runtime. So basically we can use this feature to load end points at runtime!

What if our api fails where and how to handle the error? https://stackoverflow.com/questions/48564687/how-to-handle-inform-users-about-unrecoverable-exceptions-in-an-app-initializer


  1. HTTP_INTERCEPTORS

  1. Global Error Handler

  1. Subject With Service Pattern to Ngrx With Facade Pattern !

  1. Change Detection - onPush, NgZone, Unidirectional Data Flow

  1. Content Projection & Template Ref's

  1. Dynamic Components via Host Views or Components

  1. Presenter Container Component Pattern

  1. Router Guards

  1. Authentication

  1. Lazy Loading

  1. Source Map Explorer & Bundle Budgets!

  1. Control Value Accessor

  1. Typeahead Component

  1. Angular CDK like Overlay, Portal etc.

  1. Dependency Injection, Injection Tokens,

  1. Unit Testing

  1. TypeScript

About

Implementing best practices of Angular: APP_INITIALIZER , HTTP_INTERCEPTORS , Custom Error Handling, Content Projection, TemplateRef's & ViewContainerRef for creating reusable templates and Custom Structural Directives , SCAM ,SOLID, TDD, Lazy Loading, Dependency Injection Injection Tokens, useValue, useFactory

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published