Skip to content

Commit

Permalink
feat(transloco): 🎸 add a template context guard to directive (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serrulien authored Nov 9, 2021
1 parent ab68d0c commit 48f924d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libs/transloco/src/lib/transloco.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ export class TranslocoDirective implements OnInit, OnDestroy, OnChanges {
private langResolver = new LangResolver();
private scopeResolver = new ScopeResolver(this.translocoService);

static ngTemplateContextGuard(
dir: TranslocoDirective,
ctx: unknown
): ctx is ViewContext {
return true;
}

constructor(
private translocoService: TranslocoService,
@Optional() private tpl: TemplateRef<ViewContext>,
Expand Down

0 comments on commit 48f924d

Please sign in to comment.