Я исправил это с помощью: приращения и: уменьшения, которые не вызывались при использовании прямого URL. Похоже на это.
const routes: Routes = [
{path: '', component: LoadingComponent, pathMatch: 'full', data: {i: -1}},
{path: 'login', component: LoginComponent, data: {i: 0}},
{path: 'client/:client/panel', component: ClientPanelComponent, canActivate: [AuthGuard], data: {i: 1}}
];
export const routerAnimation = trigger('routerTransition', [
transition('-1 => *', [
query(':enter, :leave', style({ position: 'fixed', width:'100%', height: '100%' }), {optional: true}),
group([
query(
':enter',
[
style({opacity: 0}),
animate('300ms', style({opacity: 1}))
],
{optional: true}
),
query(
':leave',
[
style({opacity: 1}),
animate('300ms', style({opacity: 0}))
],
{optional: true}
)
])
]),
transition(':decrement', [
query(':enter, :leave', style({ position: 'fixed', width:'100%', height: '100%' }), {optional: true}),
group([
query(
':enter',
[
style({transform: 'translateX(-100%)'}),
animate('300ms ease-in', style({transform: 'translateX(0)'}))
],
{optional: true}
),
query(
':leave',
[
style({transform: 'translateX(0)'}),
animate('300ms ease-in', style({transform: 'translateX(100%)'}))
],
{optional: true}
)
])
]),
transition(':increment', [
query(':enter, :leave', style({ position: 'fixed', width:'100%', height: '100%' }), {optional: true}),
group([
query(
':enter',
[
style({transform: 'translateX(100%)'}),
animate('300ms ease-in', style({transform: 'translateX(0)'}))
],
{optional: true}
),
query(
':leave',
[
style({transform: 'translateX(0)'}),
animate('300ms ease-in', style({transform: 'translateX(-100%)'}))
],
{optional: true}
)
])
]),
transition('* <=> *', [
query(':enter, :leave', style({ position: 'fixed', width:'100%', height: '100%' }), {optional: true}),
group([
query(
':enter',
[
style({opacity: 0}),
animate('300ms', style({opacity: 1}))
],
{optional: true}
),
query(
':leave',
[
style({opacity: 1}),
animate('300ms', style({opacity: 0}))
],
{optional: true}
)
])
])
]);