Created
January 15, 2022 19:23
-
-
Save melcor76/b0b2b7cc6d75c5d115a67de5abd81e79 to your computer and use it in GitHub Desktop.
Structural directive - inpuyt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Directive({ selector: '[hasRole]' }) | |
export class HasRoleDirective { | |
constructor( | |
private templateRef: TemplateRef<any> | |
private viewContainer: ViewContainerRef) {} | |
@Input('hasRole') | |
roles: string[]; | |
@Input('hasRoleElse') | |
else: string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment