angular-practice/demo-app/learnings.md

958 B

Learnings 02.05.2025

  • main.ts --populates-> index.html

  • app.component.ts == root component -> may also handle routing

  • component hierarchy: components talk to subcomponents via "Inputs" ("inheritance")

    • used with property bindings ([bla]="value")
    • or interpolation/mustache syntax ({{ value }})
  • components have html template, css style (scss, css, etc.), and ts (ts, class, decorators)

    • all can be in separate files
  • angular directives for "template metaprogramming"

    • ngFor, ngForOf, etc.
  • per route: render a different component (SPA) (handled by @angular/router)

  • Route parameters (:id) enable to pass data to the components from the URL

  • services (i.e. return json asynchronously, etc.) inject into other components to make (dynamic) data available and reduce coupling -> dependency injection ^^/

  • Angular Forms: event listeners: (event), (submit), etc.

  • HTTP communication via fetch (not Angular specific)