Answers for "reload a child component in angular"

1

reload a child component in angular

import { Component, Input, OnChanges } from "@angular/core";

@Component({
  selector: "child-component",
  templateUrl: "./child-component.html"
})
export class MyComponent implements OnChanges {
  @Input() someInput: string;

  constructor() {}

  ngOnChanges() {
  /**********THIS FUNCTION WILL TRIGGER WHEN PARENT COMPONENT UPDATES 'someInput'**************/
  //Write your code here
   console.log(this.someInput);
  }   
 
}
Posted by: Guest on December-02-2020
0

reload a child component in angular

<child-component [someInput]="inputValue"></child-component>
Posted by: Guest on December-02-2020

Code answers related to "reload a child component in angular"

Code answers related to "Javascript"

Browse Popular Code Answers by Language