-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Define generic of ng-template #28731
Copy link
Copy link
Open
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilerarea: coreIssues related to the framework runtimeIssues related to the framework runtimecompiler: template type-checkingcore: ng-template and *microsyntaxfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration
Milestone
Metadata
Metadata
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilerarea: coreIssues related to the framework runtimeIssues related to the framework runtimecompiler: template type-checkingcore: ng-template and *microsyntaxfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration
Type
Fields
Give feedbackNo fields configured for issues without a type.
🚀 feature request
Relevant Package
This feature request is for @angular/language-serviceDescription
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:
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