Fuck.n router animation..

This commit is contained in:
mustafahlvc
2017-08-19 16:20:09 +03:00
parent b8d5c16237
commit d70ad0d3c7
2 changed files with 61 additions and 9 deletions

View File

@@ -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()