Thursday, February 23, 2023

How Access Between Angular

  • From Parent to access child component
    • @ViewChild()
  • Pass Data between child and parent component
    • @Input() 
      • data from parent to child
      • @Input() item = ''; // decorate the property with @Input()
      • Directive From Parent Component
      • <app-item-detail [item]="currentItem"></app-item-detail>
    • @Output()
      • data from child to parent with the help of the event.
      • to raise event must have EventEmitter

No comments:

Post a Comment