From 9fc42b19c092192ed61c16d379a84f01dabc73b4 Mon Sep 17 00:00:00 2001 From: Dmitry Nehaychik <4dmitr@gmail.com> Date: Wed, 6 Feb 2019 11:47:51 +0300 Subject: [PATCH] fix(bundles): simplify features block --- .../data/service/descriptions.service.ts | 14 ++++++------- .../backend-bundles-section.component.html | 2 +- .../backend-bundles-section.component.ts | 21 +++++++------------ ...-landing-sections-container.component.html | 2 +- ...gx-landing-sections-container.component.ts | 19 +++++------------ 5 files changed, 20 insertions(+), 38 deletions(-) diff --git a/docs/app/@core/data/service/descriptions.service.ts b/docs/app/@core/data/service/descriptions.service.ts index 90140796..df5ada97 100644 --- a/docs/app/@core/data/service/descriptions.service.ts +++ b/docs/app/@core/data/service/descriptions.service.ts @@ -33,13 +33,6 @@ export class DescriptionsService { description: 'Continuous updates and fixes from the development team to keep your tech up to date. The friendly and active community support team are ready to guide you through your challenges', }, ]; - /* tslint:enable:max-line-length */ - - getDescriptions(): Observable { - return observableOf(this.descriptions); - } - - /* tslint:disable:max-line-length */ private bundleDescriptions: Descriptions[] = [ { icon: 'umbrella-outline', @@ -62,7 +55,12 @@ export class DescriptionsService { description: 'We prepared this Backend pack as development basement which lets your team concentrate on business logic and data models.', }, ]; - /* tslint:enable:max-line-length */ + + /* tslint:disable:max-line-length */ + + getDescriptions(): Observable { + return observableOf(this.descriptions); + } getBundleDescriptions(): Observable { return observableOf(this.bundleDescriptions); diff --git a/docs/app/pages/home/backend-bundles-section/backend-bundles-section.component.html b/docs/app/pages/home/backend-bundles-section/backend-bundles-section.component.html index 732882ed..efb65ca6 100644 --- a/docs/app/pages/home/backend-bundles-section/backend-bundles-section.component.html +++ b/docs/app/pages/home/backend-bundles-section/backend-bundles-section.component.html @@ -241,7 +241,7 @@ - + Architecture Design diff --git a/docs/app/pages/home/backend-bundles-section/backend-bundles-section.component.ts b/docs/app/pages/home/backend-bundles-section/backend-bundles-section.component.ts index d6f6d77d..7e54f9d8 100644 --- a/docs/app/pages/home/backend-bundles-section/backend-bundles-section.component.ts +++ b/docs/app/pages/home/backend-bundles-section/backend-bundles-section.component.ts @@ -4,22 +4,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. */ -import { AfterViewInit, Component, ElementRef, Inject, OnDestroy } from '@angular/core'; -import { Descriptions, DescriptionsService } from '../../../@core/data/service/descriptions.service'; -import { delay, filter, take, takeWhile } from 'rxjs/operators'; +import { AfterViewInit, Component, ElementRef, Inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { Observable } from 'rxjs'; +import { delay, filter, take } from 'rxjs/operators'; import { NB_WINDOW } from '@nebular/theme'; +import { Descriptions, DescriptionsService } from '../../../@core/data/service/descriptions.service'; + @Component({ selector: 'ngx-backend-bundles-section', templateUrl: 'backend-bundles-section.component.html', styleUrls: ['./backend-bundles-section.component.scss'], }) +export class BackendBundlesSectionComponent implements AfterViewInit { -export class BackendBundlesSectionComponent implements OnDestroy, AfterViewInit { - - private alive = true; - descriptions: Descriptions[]; + descriptions: Observable = this.descriptionsService.getDescriptions(); selectedLicenseType = 'Personal'; personalLicense = 'Personal'; @@ -56,9 +56,6 @@ export class BackendBundlesSectionComponent implements OnDestroy, AfterViewInit private activatedRoute: ActivatedRoute, private el: ElementRef, @Inject(NB_WINDOW) private window) { - this.descriptionsService.getBundleDescriptions() - .pipe(takeWhile(() => this.alive)) - .subscribe((descriptions) => this.descriptions = descriptions); } isCommercial() { @@ -77,10 +74,6 @@ export class BackendBundlesSectionComponent implements OnDestroy, AfterViewInit }); } - ngOnDestroy() { - this.alive = false; - } - private getMailToText(bundleName: string) { return 'mailto:support@akveo.com' + `?subject=${this.selectedLicenseType} ${bundleName} Bundle` + diff --git a/docs/app/pages/home/sections-container/ngx-landing-sections-container.component.html b/docs/app/pages/home/sections-container/ngx-landing-sections-container.component.html index 5bc1571b..42731642 100644 --- a/docs/app/pages/home/sections-container/ngx-landing-sections-container.component.html +++ b/docs/app/pages/home/sections-container/ngx-landing-sections-container.component.html @@ -2,7 +2,7 @@ - + diff --git a/docs/app/pages/home/sections-container/ngx-landing-sections-container.component.ts b/docs/app/pages/home/sections-container/ngx-landing-sections-container.component.ts index 208d32ac..d4bea844 100644 --- a/docs/app/pages/home/sections-container/ngx-landing-sections-container.component.ts +++ b/docs/app/pages/home/sections-container/ngx-landing-sections-container.component.ts @@ -4,27 +4,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. */ -import { Component, OnDestroy } from '@angular/core'; +import { Component } from '@angular/core'; +import { Observable } from 'rxjs'; import { Descriptions, DescriptionsService } from '../../../@core/data/service/descriptions.service'; -import { takeWhile } from 'rxjs/operators'; @Component({ selector: 'ngx-landing-sections-container', templateUrl: './ngx-landing-sections-container.component.html', styleUrls: ['./ngx-landing-sections-container.component.scss'], }) -export class NgxLandingSectionsContainerComponent implements OnDestroy { +export class NgxLandingSectionsContainerComponent { - private alive = true; - descriptions: Descriptions[]; + descriptions: Observable = this.descriptionsService.getDescriptions(); - constructor(private descriptionsService: DescriptionsService) { - this.descriptionsService.getDescriptions() - .pipe(takeWhile(() => this.alive)) - .subscribe((descriptions) => this.descriptions = descriptions); - } - - ngOnDestroy() { - this.alive = false; - } + constructor(private descriptionsService: DescriptionsService) { } }