-
Notifications
You must be signed in to change notification settings - Fork 25.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Structural directives documentation does not mention type guards #33905
Comments
The corresponding implementations in NgIf¹ and NgForOf² do comment on this fairly well, which I assume is due to this being emitted into thee API docs. But I think it would be good to actually put it into the above mentioned guide. ¹ https://github.com/angular/angular/blob/8.2.14/packages/common/src/directives/ng_if.ts#L227 |
@Airblader Can you suggest what needs to be said about it? I assume it would be in the last section, the example of defining a custom structural directive. |
I was thinking along the lines of
Please note that it might be worth having someone double-check the accuracy of these descriptions (who knows, maybe I'm misunderstanding them).
Yeah, sounds like a great idea. :-) |
BTW, there's a very similar ngAcceptInputType_* feature which is documented already, so it can serve as a good reference: https://next.angular.io/guide/aot-compiler#input-setter-coercion |
@mhevery @jbogarthyde This issue can be closed, right? The PR has been merged and is live on the website. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Description
The documentation for structural directives make no mention of type guards for either inputs or the context (ngTemplateGuard_x, ngTemplateContextGuard). However, especially with Ivy this will be important information for anyone looking to write custom structural directives.
What's the affected URL?**
https://angular.io/guide/structural-directives
The text was updated successfully, but these errors were encountered: