Answers for "reload component and child 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 sub component angular

this.router.navigateByUrl('/RefreshComponent', { skipLocationChange: true }).then(() => {
    this.router.navigate(['Your actualComponent']);
});
Posted by: Guest on March-18-2021

Code answers related to "reload component and child angular"

Code answers related to "Javascript"

Browse Popular Code Answers by Language