Alguma maneira de implementar um loading no CanActivate em Angular 11?
import { NgModule } from '@angular/core';
import { AngularFireAuthGuard, redirectUnauthorizedTo } from '@angular/fire/auth-guard';
import { RouterModule, Routes } from '@angular/router';
import { ListaComponent } from './lista/lista.component';
import { MensagemComponent } from './mensagem/mensagem.component';
const redirectUnauthorizedToLogin = () => redirectUnauthorizedTo(['/login']);
const routes: Routes = [
{
path: '',
redirectTo: 'lista',
pathMatch: 'full'
},
{
path: 'lista',
component: ListaComponent,
canActivate: [ AngularFireAuthGuard ],
data: { authGuardPipe: redirectUnauthorizedToLogin }
},
{
path: 'mensagem',
component: MensagemComponent
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class ViewsRoutingModule { }