PR Close #35561
This commit is contained in:

committed by
Miško Hevery

parent
bd6a39c364
commit
54fd33fb80
@ -43,6 +43,7 @@ import * as ParsingCases from './parsing-cases';
|
||||
ParsingCases.StringModel,
|
||||
ParsingCases.TemplateReference,
|
||||
ParsingCases.TestComponent,
|
||||
ParsingCases.WithContextDirective,
|
||||
]
|
||||
})
|
||||
export class AppModule {
|
||||
|
@ -127,6 +127,21 @@ export class CounterDirective implements OnChanges {
|
||||
}
|
||||
}
|
||||
|
||||
interface WithContextDirectiveContext {
|
||||
$implicit: {implicitPerson: Person;};
|
||||
nonImplicitPerson: Person;
|
||||
}
|
||||
|
||||
@Directive({selector: '[withContext]'})
|
||||
export class WithContextDirective {
|
||||
constructor(_template: TemplateRef<WithContextDirectiveContext>) {}
|
||||
|
||||
static ngTemplateContextGuard(dir: WithContextDirective, ctx: unknown):
|
||||
ctx is WithContextDirectiveContext {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This Component provides the `test-comp` selector.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user