Skip to content

Instantly share code, notes, and snippets.

@romko391
Last active October 22, 2019 15:25
Show Gist options
  • Save romko391/ca9b97a3b9fcfbd58484d02f10b5b92a to your computer and use it in GitHub Desktop.
Save romko391/ca9b97a3b9fcfbd58484d02f10b5b92a to your computer and use it in GitHub Desktop.
Angular basics

Components vs Directives

  • what's the scope of usage of each one, when to chose what

Directives

  • structural vs non-structural
  • *ngIf, *ngFor, ngSwitch, *ngTemplateOutlet, *ngComponentOutlet
  • ng-template, ng-container, ng-content elements
  • performance optimisations for *ngFor

Pipes

  • pure vs non-pure
  • built-in pipes
  • async pipe

Components

  • Lifecycle hooks (onInit, onDestroy, onChanges) what to use and when, difference
  • Constructor vs OnInit in components
  • @Input, @Output, @Attribute decorators
  • @HostBinding, @HostListener
  • @ViewChild(ren), @ContentChild(ren)
  • view events binding (e.g. click, change)

Dependency injection

  • @Injectable, @Inject decorators
  • Module providers (global), component-scoped providers
  • What is InjectionToken
  • FactoryProvider, ClassProvider

Modules

  • lazy-loaded vs normal modules vs root module
  • @NgModule: imports, exports, declarations, entryComponents, providers properties
  • Splitting app to modules by features

Routing

  • Defining routes & child routes, route params, route path wildcards
  • Router outlet directive
  • Programmatically navigating by url, by params, relative to current route
  • routerLink, routerLinkParams directives
  • RouterModule.forRoot vs .forChild
  • Router events
  • Resolves, Guards, CanActivate(Child), CanLoad
  • Route data dictionary, params, query params dictionary
  • Accessing currently activated route in component
  • What is ActivatedRouteSnapshot?

RxJS

  • https://rxmarbles.com/ - see for visual explanation
  • https://www.learnrxjs.io/ - see for examples
  • what is rxjs and observable pattern, how it works
  • Subject types
  • what is EventEmitter?
  • most often used operators: map, filter, forkJoin, catchError, switchMap, concat*, merge*, from, of, first, share*, partition, take*, skip*
  • how to create observable
  • hot vs cold observable
  • how and why to unsubscribe from observable

Reactive forms

  • FormGroup, FormControl, FormArray, FormBuilder
  • reactive vs template-driven forms
  • how to create form and bind it to view
  • subscribing & reacting on control value changes
  • validation and validators, built-in & writing custom
  • showing validation messages depending on control's state
  • NgForm, FormGroup, FormGroupName, FormControl, FormControlName directives
  • The ControlValueAccessor interface and implementing custom form control (e.g file upload control)

HttpClient & pipeline

  • Response & Request objects
  • Response & request types
  • Handling errors
  • HttpInterceptor concept
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment