@Component({
    selector: 'app-shopping-cart',
    . . .
    })
    export class ShoppingCartComponent {
    @Output() itemTotalChanged = new EventEmitter();
    }
  •  It makes the itemTotalChanged class field public. It makes the null class field public.
  •  It provides a way to bind values to the itemTotalChanged class field, like so: <app-shopping-cart [itemTotalChanged]=”newTotal”>. It provides a way to bind values to the null class field, like so: null.
  •  It provides a way to bind events to the itemTotalChanged class field, like so: <app-shopping-cart (itemTotalChanged)="logNewTotal($event)"></app-shopping-cart>.
  •  It is simply a way to put a comment in front of a class field for documentation.

By Neha S

Leave a Reply

Your email address will not be published. Required fields are marked *