angular primeng p-table stateStorage

I have a scenario where a parent tab on submit gives child tab.

Say for example the parent tabs are A, B, C
When I click A i have dropdown and a submit button which will display table with rows. On click of the row i am redirected to child tabs A1, A2, A3, A4. When i click the main tab from child tab I have to retain the filter and sort option in main tab which i can achieve with this example stateStorage in p-table

https://www.primefaces.org/primeng/showcase/#/table/state[State example][1]

But i have an issue with this. say I am in A3, i click A – session maintained – good. I navigate to B and come back to A, session still maintained which shouldnt happen. How to reset the table session. I tried this code below in A.ts file

@ViewChild('dt') table : Table;

ngOnInit(){
////
if(this.table)
 if (obj.id ! = null)
   this.table.reset();

////
}

Where obj.id is an object that is set in this ts and child A1, A2, A3 but not on B,C,D.
But the above code doesnt work. Any input on how to achieve this please?

Source: Angular Questions