Angular notes - mhulse/mhulse.github.io GitHub Wiki

Assigning classes

Dissect: https://malcoded.com/posts/angular-ngclass/

Components vs. Directives

When I teach Angular, I keep telling my students that Angular components are custom HTML elements, while Angular directives are custom attributes.

Use components to generate chunks of HTML code, and define them as custom HTML elements. Use directives to modify the behavior or the appearance of an existing HTML element, and use an attribute to activate the directive.

https://www.beyondjava.net/angular-components-non-standard-selectors

Template syntax

  • # = Template reference variable (declares DOM elements as variables: <div #myDiv>blah</div>)
  • () = Event binding
  • [] = Property binding
  • [()] = Two-way property binding
  • {{ }} = Interpolation
  • * = Structural directives
⚠️ **GitHub.com Fallback** ⚠️