This component allows you to show skeletons of pages during navigation process.
$ npm install @tinkoff/navigation-skeleton
-
Add
NavigationSkeletonModule,
to theimports
section of root module.@NgModule({ ... imports: [ ... RouterModule.forRoot(...), NavigationSkeletonModule, ], }) export class AppModule {}
-
Change
<router-outlet></router-outlet>
to<tcs-navigation-skeleton> <router-outlet></router-outlet> </tcs-navigation-skeleton>
-
Add skeleton component to the route definition
const route: NavigationSkeletonRoute = { path: '...', component: ..., skeleton: { component: MySkeletonComponent, }, };