Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import { Component, EventEmitter, Output } from '@angular/core';
selector: 'app-child',
template: `<button class='btn btn-primary' (click)="valueChanged()">Click me</button> `
export class AppChildComponent {
@Output() valueChange = new EventEmitter();
Counter = 0;
valueChanged() { // You can give any function name
this.counter = this.counter + 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment