feat(ivy): resolve forwardRef() for queries (#25080)

@ContentChild[ren] and @ViewChild[ren] can contain a forwardRef() to a
type. This commit allows ngtsc to unwrap the forward reference and
deal with the node inside.

It includes two modes of support for forward reference resolution -
a foreign function resolver which understands deeply nested forward
references in expressions that are being statically evaluated, and
an unwrapForwardRef() function which deals only with top-level nodes.

Both will be useful in the future, but for now only unwrapForwardRef()
is used.

PR Close #25080
This commit is contained in:
Alex Rickabaugh
2018-07-24 16:05:23 -07:00
committed by Igor Minar
parent 48d7205873
commit f902b5ec59
6 changed files with 122 additions and 23 deletions

View File

@ -48,4 +48,8 @@ export class ChangeDetectorRef {}
export class ElementRef {}
export class Injector {}
export class TemplateRef {}
export class ViewContainerRef {}
export class ViewContainerRef {}
export function forwardRef<T>(fn: () => T): T {
return fn();
}