Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Angular Property Binding - Child Component
<p>Parent Input is: {{parentInput}} </p>
<label >Child Component Input: </label>
<input type="text" [ngModel]="childTextValue" (ngModelChange)="updateOutput($event)">
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
selector: 'app-child',
templateUrl: './child.component.html',
styleUrls: ['./child.component.css']
export class ChildComponent implements OnInit {
@Input() parentInput: string;
@Output() childOutput = new EventEmitter<string>();
childTextValue = '';
constructor() { }
ngOnInit() {
updateOutput(value) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment