feat(compiler): Added support for limited function calls in metadata. (#9125)
The collector now collects the body of functions that return an expression as a symbolic 'function'. The static reflector supports expanding these functions statically to allow provider macros. Also added support for the array spread operator in both the collector and the static reflector.
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
import * as common from '@angular/common';
|
||||
import {Component, Inject, OpaqueToken} from '@angular/core';
|
||||
|
||||
import {wrapInArray} from './funcs';
|
||||
|
||||
export const SOME_OPAQUE_TOKEN = new OpaqueToken('opaqueToken');
|
||||
|
||||
@Component({
|
||||
@ -23,7 +25,7 @@ export class CompWithProviders {
|
||||
<input #a>{{a.value}}
|
||||
<div *ngIf="true">{{a.value}}</div>
|
||||
`,
|
||||
directives: [common.NgIf]
|
||||
directives: [wrapInArray(common.NgIf)]
|
||||
})
|
||||
export class CompWithReferences {
|
||||
}
|
||||
|
@ -0,0 +1,3 @@
|
||||
export function wrapInArray(value: any): any[] {
|
||||
return [value];
|
||||
}
|
Reference in New Issue
Block a user