Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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);
  }   
 
}
Comment

reload a child component in angular

<child-component [someInput]="inputValue"></child-component>
Comment

PREVIOUS NEXT
Code Example
Javascript :: is javascript good 
Javascript :: Use Destructuring Assignment with the Rest Operator to Reassign Array Elements 
Javascript :: quotation marks javascript 
Javascript :: js calculate distance between two coordinates 
Javascript :: if else js 
Javascript :: how to remove class in all siblings javascript 
Javascript :: Disable button if one of the checkboxes are not checked 
Javascript :: object traversal javascript 
Javascript :: node require module 
Javascript :: js list of objects 
Javascript :: ajaxcomplete jquery example 
Javascript :: passing html vlaues to Javascript function 
Javascript :: how would you check if a number is an integer in javascript 
Javascript :: check a string for unique characters javascript 
Javascript :: resize function in addEventListener JS 
Javascript :: react download file from express res.download 
Javascript :: js function string parameter 
Javascript :: what is interpolatin in javascript 
Javascript :: get all days of month javascript 
Javascript :: number is prime or not in javascript 
Javascript :: node js kill process 
Javascript :: get value for radio button in jquery label 
Javascript :: image preview before upload jquery 
Javascript :: js check if two arrays contain same values 
Javascript :: how to get common elements from two array in javascript using lodash 
Javascript :: antd dropdown stop propogation 
Javascript :: change image src using jquery 
Javascript :: countdown in js 
Javascript :: how to take screenshot of desktop using electron js 
Javascript :: replace object in array with another array with same id javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =