AW-3441 another fix...
All checks were successful
FarmMaps/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import {Directive, Input, OnDestroy, TemplateRef, ViewContainerRef} from '@angular/core';
|
||||
import {AfterViewInit, Directive, Input, OnDestroy, TemplateRef, ViewContainerRef} from '@angular/core';
|
||||
import {Subscription} from 'rxjs';
|
||||
import {PackageService} from '../../services/package.service';
|
||||
import * as appCommonReducer from '../../reducers/app-common.reducer';
|
||||
import {Store} from '@ngrx/store';
|
||||
|
||||
@Directive({
|
||||
selector: '[fmHasPackage]',
|
||||
})
|
||||
export class HasPackageDirective implements OnDestroy {
|
||||
export class HasPackageDirective implements OnDestroy, AfterViewInit {
|
||||
|
||||
@Input()
|
||||
set fmHasPackage(packageIdentifier: string) {
|
||||
@@ -31,8 +33,14 @@ export class HasPackageDirective implements OnDestroy {
|
||||
private packSub: Subscription;
|
||||
|
||||
constructor(private hostTemplateRef: TemplateRef<any>, private viewContainerRef: ViewContainerRef,
|
||||
private packageService: PackageService) {
|
||||
private store: Store<appCommonReducer.State>, private packageService: PackageService) {
|
||||
this.thenTemplate = hostTemplateRef;
|
||||
this.packSub = this.store.select(appCommonReducer.SelectGetUserPackages).subscribe((_) => {
|
||||
this.updateView();
|
||||
});
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.updateView();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user