refactor: clean code
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import {Directive, Input, TemplateRef, ViewContainerRef} from '@angular/core';
|
||||
import AuthApiService from "@api/v1/authApiService";
|
||||
import {AuthRoles} from "@model/AuthRoles";
|
||||
import {AuthRoles} from "@model/authRoles";
|
||||
import {catchError, of} from "rxjs";
|
||||
|
||||
@Directive({
|
||||
@ -13,7 +13,8 @@ export class HasRoleDirective {
|
||||
private templateRef: TemplateRef<any>,
|
||||
private viewContainer: ViewContainerRef,
|
||||
private authService: AuthApiService
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
@Input() set appHasRole(role: AuthRoles) {
|
||||
this.viewContainer.clear();
|
||||
@ -29,6 +30,6 @@ export class HasRoleDirective {
|
||||
this.viewContainer.createEmbeddedView(this.templateRef);
|
||||
else
|
||||
this.viewContainer.clear();
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user