Skip to content

Instantly share code, notes, and snippets.

@melcor76
Created January 15, 2022 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melcor76/b0b2b7cc6d75c5d115a67de5abd81e79 to your computer and use it in GitHub Desktop.
Save melcor76/b0b2b7cc6d75c5d115a67de5abd81e79 to your computer and use it in GitHub Desktop.
Structural directive - inpuyt
@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