Put in order · Angular course · Module 2: Components
@Input and @Output Data Flow
Arrange the steps of the data flow in parent-child communication via @Output (top to bottom):
Items to put in order
- The child declares @Output() with an EventEmitter
- An event occurs in the child (e.g. a click)
- The parent receives the event via (event)="handler($event)"
- The child calls .emit(data)
Show the answer
Correct order:
- The child declares @Output() with an EventEmitter
- An event occurs in the child (e.g. a click)
- The child calls .emit(data)
- The parent receives the event via (event)="handler($event)"