Created
August 14, 2018 17:05
-
-
Save ldmarz/1f45da80f95cef4042785f82158816d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, ViewChild } from '@angular/core'; | |
import { SomeChildComponent } from './someChild/someChild.component'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.css'] | |
}) | |
export class AppComponent { | |
@ViewChild(SomeChildComponent) someChildComponent; | |
callChildFunction() { | |
console.log(this.someChildComponent); // Here you have one reference to your child component | |
this.someChildComponent.callSomeFunction(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment