October 2018
Beginner to intermediate
478 pages
10h 8m
English
You use the @Output decorator when a component is supposed to notify a parent when something occurs. For this purpose, you use EventEmitter, Angular's events abstraction. Then the parent component can subscribe to these events using event bindings and respond to them.
Let's use @Output in the category menu-related components:
import { Component, Input, Output, EventEmitter } from '@angular/core'; @Component({ selector: 'app-category-menu-item', templateUrl: './category-menu-item.component.html', styleUrls: ['./category-menu-item.component.css'] ...Read now
Unlock full access