Fix fm-hasclaim
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma 2020-09-03 12:43:55 +02:00
parent 1030b1c41a
commit 78425a621a
2 changed files with 3 additions and 2 deletions

View File

@ -14,11 +14,11 @@ export class HasClaimDirective implements OnInit{
@Input('fm-hasclaim') claim:string; @Input('fm-hasclaim') claim:string;
constructor(private templateRef$: TemplateRef<any>,private viewContainerRef$: ViewContainerRef,private store$: Store<appCommonReducer.State>) { } constructor(private templateRef$: TemplateRef<any>,private viewContainerRef$: ViewContainerRef,private store$: Store<appCommonReducer.State>) { }
private user$:Observable<IUser> = this.store$.select(appCommonReducer.SelectGetUser).pipe(skip(1)); private user$:Observable<IUser> = this.store$.select(appCommonReducer.SelectGetUser);
private hasView = false; private hasView = false;
ngOnInit() { ngOnInit() {
this.user$.subscribe((user) => { this.user$.subscribe((user) => {
if (user.claims[this.claim]) { if (user && user.claims[this.claim]) {
this.viewContainerRef$.createEmbeddedView(this.templateRef$); this.viewContainerRef$.createEmbeddedView(this.templateRef$);
this.hasView=true; this.hasView=true;
} else if (this.hasView) { } else if (this.hasView) {

View File

@ -10,6 +10,7 @@
"moduleResolution": "node", "moduleResolution": "node",
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"importHelpers": true, "importHelpers": true,
"target": "es2015", "target": "es2015",
"typeRoots": [ "typeRoots": [