Notes on Angular 8
Any directive with an asterisk, *, is a structural directive.

Interpolation syntax {{ }}. Interpolation renders a property's value as text.

Property binding [ ] syntax.  Property binding [ ] lets you use the property value in a template expression.
  • I use binding to pass a variable I have created in my template
  • I don’t use the brackets if I pass a string for example.

Event binding uses a set of parentheses, ( ), around the event

The selector identifies the component

Component interaction is a very important document: https://angular.io/guide/component-interaction

Share data through service.  In Angular, a service is an instance of a class that can be made available to any part of your application using Angular's dependency injection system. Services are the place where you share data between parts of your application. For the online store, the cart service is where you store your cart data and methods.

There are two parts to an Angular Reactive form, the objects that live in the component to store and manage the form, and the visualization of the form that lives in the template.

Every component must be declared in exactly one NgModule.
All HttpClient methods return an RxJS Observable of something.
As a rule, an Observable does nothing until something subscribes.
two-way data binding, meaning that changes in the DOM, such as user choices, are also reflected in your program data.
A component and its template together define a view
In JavaScript each file is a module and all objects defined in the file belong to that module.

Data-binding markup



Ideally, a component's job is to enable the user experience and nothing more.

DI
  • When you provide the service at the root level, Angular creates a single, shared instance of HeroService and injects it into any class that asks for it.
  • When you register a provider with a specific NgModule, the same instance of a service is available to all components in that NgModule.
  • When you register a provider at the component level, you get a new instance of the service with each new instance of that component.

Properties should better be initialized using a constructor.

Summary:
  • Interpolation with double curly braces to display a component property.
  • ngFor to display an array of items.
  • A TypeScript class to shape the model data for your component and display properties of that model.
  • ngIf to conditionally display a chunk of HTML based on a boolean expression.

Template Syntax