fix(ivy): types in .d.ts files should account for generics (#24862)

Ivy definition types have a generic type which specifies the return
type of the factory function. For example:

static ngDirectiveDef<NgForOf, '[ngFor][ngForOf]'>

However, in this case NgForOf itself has a type parameter <T>. Thus,
writing the above is incorrect.

This commit modifies ngtsc to understand the genericness of NgForOf and
to write the following:

static ngDirectiveDef<NgForOf<any>, '[ngFor][ngForOf]'>

PR Close #24862
This commit is contained in:
Alex Rickabaugh
2018-07-13 14:49:01 -07:00
committed by Victor Berchet
parent 2b8b647006
commit 41ef75869c
8 changed files with 53 additions and 12 deletions

View File

@ -25,6 +25,11 @@ export interface R3DirectiveMetadata {
*/
type: o.Expression;
/**
* Number of generic type parameters of the type itself.
*/
typeArgumentCount: number;
/**
* A source span for the directive type.
*/