mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2026-03-21 20:58:41 +00:00
Fuck.n router animation..
This commit is contained in:
@@ -1,20 +1,30 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, HostBinding, OnInit } from '@angular/core';
|
||||
import { PerfectScrollbarDirective } from 'ngx-perfect-scrollbar';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
|
||||
import { Animations } from '../../core/animations';
|
||||
|
||||
@Component({
|
||||
selector : 'fuse-content',
|
||||
templateUrl: './content.component.html',
|
||||
styleUrls : ['./content.component.scss']
|
||||
styleUrls : ['./content.component.scss'],
|
||||
animations : [Animations.routerTransition]
|
||||
})
|
||||
export class FuseContentComponent implements OnInit
|
||||
{
|
||||
@HostBinding('@routerTransition') routeAnimationState = false;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private perfectScrollbarDirective: PerfectScrollbarDirective
|
||||
)
|
||||
{
|
||||
|
||||
this.router.events
|
||||
.filter((event) => event instanceof NavigationEnd)
|
||||
.map(() => this.activatedRoute)
|
||||
.subscribe((event) => {
|
||||
this.routeAnimationState = !this.routeAnimationState;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit()
|
||||
|
||||
Reference in New Issue
Block a user