How can i call ngonint if i am navigating from angular component function
Can you give some more details or a sample demonstrating the scenario?
I'm not sure how do you navigate through the components and which ngOnInit you need to invoke.
I am trying to navigate from one component1 to some other component2,when user click on button inside ig grid
This is the button inside the iggrid
<input type='button' value='${documentId}' class='btn btn-sm btn-primary' onclick='angularComponentRef.componentFn(\"${transactionId}\")'
in component1 constructor wrote function
window['angularComponentRef'] = { zone: this.zone, componentFn: (value) => { this.test(value) }, component: this };
here i am trying to navigate to the component2
test(val1) { this.router.navigate(['/transactions/transaction/'+val1+'/PurchaseOrder']) // this.router.navigate([val]); }
Its navigated to component2 but its not calling ngOnInit() of component2
How can I fix this.Do you need any other info please let me know