-
Notifications
You must be signed in to change notification settings - Fork 26.6k
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 *microsyntaxfeatureIssue that requests a new featureIssue that requests a new featurefeature: 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
Description
🚀 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:
<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
Airblader, earshinov, tolotrasamuel, StefanRein, PowerKiKi and 145 moretolotrasamuel, StefanRein, npeersab, osnoser1 and filiptrivantolotrasamuel, StefanRein, npeersab, osnoser1, aceArt-GmbH and 2 moretolotrasamuel, StefanRein, ScarWar, npeersab, klemenoslaj and 8 moretolotrasamuel, StefanRein, npeersab, RIPT1DE, DMezhenskyi and 5 moretolotrasamuel, StefanRein, a1pack, mateuszgiza, RIPT1DE and 7 more
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 *microsyntaxfeatureIssue that requests a new featureIssue that requests a new featurefeature: 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