Fix fm-hasclaim
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
parent
1030b1c41a
commit
78425a621a
@ -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) {
|
||||||
|
@ -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": [
|
||||||
|
Loading…
Reference in New Issue
Block a user