Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

angular call child method from parent

// How to call a child method from a parent component

import { ChildComponent } from '/somepath/childcomponent.ts';

export class ParentComponent implements onInit {
  
  @ViewChild(ChildComponent) ChildComponent;
  
  this.ChildComponent.childMethod();
Comment

angular call parent method and child method

// How to call a parent method + a child method from the parent's button click
// In hindsight, I wouldn't recommend this. But it's here if you need to use it.

<app-child #child></app-child>
<button (click)="[callParentMethod(), child.callChildMethod()]">Call</button>
Comment

PREVIOUS NEXT
Code Example
Javascript :: mongoose pagination with total count 
Javascript :: how to get the size of the window in javascript 
Javascript :: node.js child processes 
Javascript :: how to import dotenv in react 
Javascript :: javascript fs write file with folder 
Javascript :: js loop to array backwards 
Javascript :: integer to array javascript 
Javascript :: prisma query log 
Javascript :: react native making bigger hitbox 
Javascript :: javascript promise all 
Javascript :: vue scroll div to bottom 
Javascript :: how to compare objets in an array 
Javascript :: repeat an element in array in js 
Javascript :: angular redirect to external url 
Javascript :: find a word in string javascript 
Javascript :: checkbox default value and checked value get in jquery 
Javascript :: js class exists 
Javascript :: How to do a timer angular 
Javascript :: javascript progress of xml http request 
Javascript :: javascript explode space 
Javascript :: split array into chunks javascript 
Javascript :: puppeteer headless 
Javascript :: useeffect react example 
Javascript :: react native safeareaview 
Javascript :: fetch method in javascript 
Javascript :: message delete discord.js 
Javascript :: mysql json_array_append 
Javascript :: js subarray 
Javascript :: how to change background image dynamically in react 
Javascript :: generate random color array javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =