2016-05-11 17:38:01 +03:00
|
|
|
import {Component} from '@angular/core';
|
2016-05-02 14:49:35 +03:00
|
|
|
import {Subscription} from "rxjs/Subscription";
|
|
|
|
|
|
2016-05-04 11:49:36 +03:00
|
|
|
import {ThemeGlobal} from "../../../theme";
|
|
|
|
|
|
2016-05-02 14:49:35 +03:00
|
|
|
@Component({
|
|
|
|
|
selector: 'content-top',
|
|
|
|
|
styles: [require('./contentTop.scss')],
|
|
|
|
|
template: require('./contentTop.html'),
|
|
|
|
|
})
|
|
|
|
|
export class ContentTop {
|
|
|
|
|
activePageTitle = '';
|
|
|
|
|
private _themeGlobalSubscription:Subscription;
|
|
|
|
|
|
|
|
|
|
constructor(private _themeGlobal:ThemeGlobal) {
|
|
|
|
|
this._themeGlobalSubscription = this._themeGlobal.getDataStream().subscribe((data) => {
|
|
|
|
|
this.activePageTitle = data['menu.activeLink'] != null ? data['menu.activeLink'].title : this.activePageTitle;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnDestroy() {
|
|
|
|
|
// prevent memory leak when component destroyed
|
|
|
|
|
this._themeGlobalSubscription.unsubscribe();
|
|
|
|
|
}
|
|
|
|
|
}
|