Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 1.12 KB

README_personal.md

File metadata and controls

33 lines (26 loc) · 1.12 KB

Tour Of Heroes (personal documentation)

Go back to HOME PAGE for regular documenation.

Angular

Notes:

Component:
  • ng generate component heroes
    • creates selector, templateUrl, and styleUrls for you.
      • selector: top-layer <selector></selector>
      • templateUrl: html layout
      • styleUrls: private styling
  • import Component and OnInit from @angular/core
  • @Component is the declaration for a new component
  • OnInit is really similar to React's componentDidMount
nGFor and loops
  • *ngFor directives / ngForOf iterable / first, last, even, odd, index, count
    • Example:
      <li *ngFor="let user of users; index as i; first as isFirst">
        {{i}}/{{users.length}}. {{user}} <span *ngIf="isFirst">default</span>
      </li>
      

Helpful hints:

Angular & React Similarities:

TypeScript (.ts or .tsx file) can be involved which I already know how to write for the most part.