I have tried with following commands but after installing latest versions routing is not working saying that module not found.
Please let me know how can i update properly
ng update @angular/core @angular/cli
npm install @ionic/angular-toolkit@latest
My problem got resolved by changing syntax in router file as below
And also updated tsconfig according to Angular version12