Skip to content

Matthrews/angular-code-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular Notes

The Angular ViewChildren Decorator and QueryList in Detail

  1. @ViewChild and @ViewChildren are local template query mechanism, they can only query component references/nstivr elements of their template and nothing more, this means @ViewChild query can not see inside the templates of child components or parents components, e.g. content projected elements
  2. They are aviliable after ngAfterViewInit is called

The Angular Content Projection in Detail

<ng-content></ng-content>

Alt text Alt text

Alt text Alt text

Alt text Alt text

Tha Angular ContentChild Decorator in Detail

Alt text Alt text

Alt text Alt text

Tha Angular ng-template

Alt text Alt text

Alt text use ng-container instead, ng-container doesn't create extra elements

Angular Templates as Component Inputs

Alt text Alt text Alt text

Tha Angular Directive

  • @HostBinding
  • @HostListener
  • Export as directive instance reference, in which way you can access public properties and methods

Tha Angular Star Syntax

Alt text

Under the hood Alt text

Write custom star syntax ngxUnless

Tha Angular View Encapsulation Under the Hood

:host, ::ng-deep

with ::ng-deep to remove _ngcontent-c1 attributes

Alt text

Alt text

Alt text

Alt text

Default vs Shadow DOM

Alt text

  • ViewEncapsulation.Emulated(default)

  • ViewEncapsulation.None

  • ViewEncapsulation.ShadowDom

Angular Injectable Services

Alt text Alt text Alt text

Custom Service to fetch data

Alt text Alt text

About

Angular Code Deep Dive

Resources

Stars

Watchers

Forks