Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Parent Component
<div style="text-align:center">
Welcome to {{ title }}!
<label >Parent Component Input: </label>
<input type="text" [(ngModel)]="textInput">
<p>Child Value is: {{childValue}}</p>
<app-child [parentInput]="textInput" (childOutput)="updatedChildValue($event)"></app-child>
import { Component } from '@angular/core';
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
export class AppComponent {
textInput = '';
childValue = '';
title = 'app';
public updatedChildValue(value: string){
this.childValue = value;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment