IssueRaiser

Define generic of ng-template

<!--πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”… Oh hi there! πŸ˜„ To expedite issue processing please search open and closed issues before submitting a new one. Existing issues often contain information about workarounds, resolution, or progress updates. πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…--> # πŸš€ feature request ### Relevant Package <!-- Can you pin-point one or more @angular/* packages the are relevant for this feature request? --> <!-- ✍️edit: --> This feature request is for @angular/language-service ### Description I quite often use ng-templates in my application to later include them in the *ngTemplateOutlet and pass them the context. However when I define the template itself, it doesn't know the interface the context will have, so say this: ``` <ng-template #willUseLater let-item let-index="index"> {{index}} β€” {{item}} </ng-template> ``` Gives me an error `ng: The template context does not defined a member called 'index'.` (note also a typo here) Under ng-template there's `TemplateRef<T>`, but there is no way to define that T. ### Describe the solution you'd like Provide a way to define the generic in place without extra overhead ### Describe alternatives you've considered At least disable this error as it has no purpose if you have any complex template usage

Posted by waterplea on Feb 14, 2019, 12:55 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,000 issues0 comments

github (Other)

Define generic of ng-template

waterpleaFeb 14, 2019, 12:55 PM

<!--πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”… Oh hi there! πŸ˜„ To expedite issue processing please search open and closed issues before submitting a new one. Existing issues often contain information about workarounds, resolution, or progress updates. πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…--> # πŸš€ feature request ### Relevant Package <!-- Can you pin-point one or more @angular/* packages the are relevant for this feature request? --> <!-- ✍️edit: --> This feature request is for @angular/language-service ### Description I quite often use ng-templates in my application to later include them in the *ngTemplateOutlet and pass them the context. However when I define the template itself, it doesn't know the interface the context will have, so say this: ``` <ng-template #willUseLater let-item let-index="index"> {{index}} β€” {{item}} </ng-template> ``` Gives me an error `ng: The template context does not defined a member called 'index'.` (note also a typo here) Under ng-template there's `TemplateRef<T>`, but there is no way to define that T. ### Describe the solution you'd like Provide a way to define the generic in place without extra overhead ### Describe alternatives you've considered At least disable this error as it has no purpose if you have any complex template usage

Comments (0)

No comments yet. Start the discussion.

Comment on this issue