2018-12-26 15:17:57 +03:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright Akveo. All Rights Reserved.
|
|
|
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-05 18:53:21 +03:00
|
|
|
import { Component, OnDestroy } from '@angular/core';
|
|
|
|
|
import { Descriptions, DescriptionsService } from '../../../@core/data/service/descriptions.service';
|
|
|
|
|
import { takeWhile } from 'rxjs/operators';
|
2018-12-26 15:17:57 +03:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'ngx-landing-sections-container',
|
|
|
|
|
templateUrl: './ngx-landing-sections-container.component.html',
|
|
|
|
|
styleUrls: ['./ngx-landing-sections-container.component.scss'],
|
|
|
|
|
})
|
2019-02-05 18:53:21 +03:00
|
|
|
export class NgxLandingSectionsContainerComponent implements OnDestroy {
|
2018-12-26 15:17:57 +03:00
|
|
|
|
2019-02-05 18:53:21 +03:00
|
|
|
private alive = true;
|
|
|
|
|
descriptions: Descriptions[];
|
|
|
|
|
|
|
|
|
|
constructor(private descriptionsService: DescriptionsService) {
|
|
|
|
|
this.descriptionsService.getDescriptions()
|
|
|
|
|
.pipe(takeWhile(() => this.alive))
|
|
|
|
|
.subscribe((descriptions) => this.descriptions = descriptions);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnDestroy() {
|
|
|
|
|
this.alive = false;
|
2018-12-26 15:17:57 +03:00
|
|
|
}
|
|
|
|
|
}
|