|
|
|
@ -1,7 +1,8 @@ |
|
|
|
import { eLayoutType, SubscriptionService } from '@abp/ng.core'; |
|
|
|
import {eLayoutType, RouterEvents, SubscriptionService} from '@abp/ng.core'; |
|
|
|
import { collapseWithMargin, slideFromBottom } from '@abp/ng.theme.shared'; |
|
|
|
import { AfterViewInit, Component } from '@angular/core'; |
|
|
|
import {AfterViewInit, Component, OnDestroy} from '@angular/core'; |
|
|
|
import { LayoutService } from '../../services/layout.service'; |
|
|
|
import {Subscription} from "rxjs"; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'abp-layout-application', |
|
|
|
@ -9,13 +10,23 @@ import { LayoutService } from '../../services/layout.service'; |
|
|
|
animations: [slideFromBottom, collapseWithMargin], |
|
|
|
providers: [LayoutService, SubscriptionService], |
|
|
|
}) |
|
|
|
export class ApplicationLayoutComponent implements AfterViewInit { |
|
|
|
export class ApplicationLayoutComponent implements AfterViewInit , OnDestroy{ |
|
|
|
// required for dynamic component
|
|
|
|
static type = eLayoutType.application; |
|
|
|
|
|
|
|
constructor(public service: LayoutService) {} |
|
|
|
navigationEndSubscription:Subscription |
|
|
|
constructor(public service: LayoutService, |
|
|
|
routerEvents:RouterEvents, |
|
|
|
) { |
|
|
|
this.navigationEndSubscription = routerEvents.getNavigationEvents('End').subscribe(() => { |
|
|
|
service.isCollapsed = true; |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
ngAfterViewInit() { |
|
|
|
this.service.subscribeWindowSize(); |
|
|
|
} |
|
|
|
|
|
|
|
ngOnDestroy(): void { |
|
|
|
this.navigationEndSubscription.unsubscribe() |
|
|
|
} |
|
|
|
} |
|
|
|
|