refactor(compiler-cli): introduce declaration function to declare class metadata (#41200)
This commit refactors the generated code for class metadata in partial compilation mode. Instead of emitting class metadata into a top-level `ɵsetClassMetadata` call guarded by `ngDevMode` flags, the class metadata is now declared using a top-level `ɵɵngDeclareClassMetadata` call. PR Close #41200
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {compileClassMetadata, ConstantPool, R3ClassMetadata, R3DeclareClassMetadata, R3PartialDeclaration} from '@angular/compiler';
|
||||
import * as o from '@angular/compiler/src/output/output_ast';
|
||||
|
||||
import {AstObject} from '../../ast/ast_value';
|
||||
|
||||
import {PartialLinker} from './partial_linker';
|
||||
|
||||
/**
|
||||
* A `PartialLinker` that is designed to process `ɵɵngDeclareClassMetadata()` call expressions.
|
||||
*/
|
||||
export class PartialClassMetadataLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
|
||||
linkPartialDeclaration(
|
||||
constantPool: ConstantPool,
|
||||
metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression {
|
||||
const meta = toR3ClassMetadata(metaObj);
|
||||
return compileClassMetadata(meta);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Derives the `R3ClassMetadata` structure from the AST object.
|
||||
*/
|
||||
export function toR3ClassMetadata<TExpression>(
|
||||
metaObj: AstObject<R3DeclareClassMetadata, TExpression>): R3ClassMetadata {
|
||||
return {
|
||||
type: metaObj.getOpaque('type'),
|
||||
decorators: metaObj.getOpaque('decorators'),
|
||||
ctorParameters: metaObj.has('ctorParameters') ? metaObj.getOpaque('ctorParameters') : null,
|
||||
propDecorators: metaObj.has('propDecorators') ? metaObj.getOpaque('propDecorators') : null,
|
||||
};
|
||||
}
|
||||
+9
-2
@@ -11,6 +11,7 @@ import {AbsoluteFsPath} from '../../../../src/ngtsc/file_system';
|
||||
import {createGetSourceFile} from '../get_source_file';
|
||||
import {LinkerEnvironment} from '../linker_environment';
|
||||
|
||||
import {PartialClassMetadataLinkerVersion1} from './partial_class_metadata_linker_1';
|
||||
import {PartialComponentLinkerVersion1} from './partial_component_linker_1';
|
||||
import {PartialDirectiveLinkerVersion1} from './partial_directive_linker_1';
|
||||
import {PartialFactoryLinkerVersion1} from './partial_factory_linker_1';
|
||||
@@ -21,6 +22,7 @@ import {PartialNgModuleLinkerVersion1} from './partial_ng_module_linker_1';
|
||||
import {PartialPipeLinkerVersion1} from './partial_pipe_linker_1';
|
||||
|
||||
export const ɵɵngDeclareDirective = 'ɵɵngDeclareDirective';
|
||||
export const ɵɵngDeclareClassMetadata = 'ɵɵngDeclareClassMetadata';
|
||||
export const ɵɵngDeclareComponent = 'ɵɵngDeclareComponent';
|
||||
export const ɵɵngDeclareFactory = 'ɵɵngDeclareFactory';
|
||||
export const ɵɵngDeclareInjectable = 'ɵɵngDeclareInjectable';
|
||||
@@ -28,8 +30,8 @@ export const ɵɵngDeclareInjector = 'ɵɵngDeclareInjector';
|
||||
export const ɵɵngDeclareNgModule = 'ɵɵngDeclareNgModule';
|
||||
export const ɵɵngDeclarePipe = 'ɵɵngDeclarePipe';
|
||||
export const declarationFunctions = [
|
||||
ɵɵngDeclareDirective, ɵɵngDeclareComponent, ɵɵngDeclareFactory, ɵɵngDeclareInjectable,
|
||||
ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe
|
||||
ɵɵngDeclareDirective, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareFactory,
|
||||
ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe
|
||||
];
|
||||
|
||||
interface LinkerRange<TExpression> {
|
||||
@@ -91,6 +93,7 @@ export class PartialLinkerSelector<TStatement, TExpression> {
|
||||
environment: LinkerEnvironment<TStatement, TExpression>, sourceUrl: AbsoluteFsPath,
|
||||
code: string): Map<string, LinkerRange<TExpression>[]> {
|
||||
const partialDirectiveLinkerVersion1 = new PartialDirectiveLinkerVersion1(sourceUrl, code);
|
||||
const partialClassMetadataLinkerVersion1 = new PartialClassMetadataLinkerVersion1();
|
||||
const partialComponentLinkerVersion1 = new PartialComponentLinkerVersion1(
|
||||
environment, createGetSourceFile(sourceUrl, code, environment.sourceFileLoader), sourceUrl,
|
||||
code);
|
||||
@@ -106,6 +109,10 @@ export class PartialLinkerSelector<TStatement, TExpression> {
|
||||
{range: '0.0.0-PLACEHOLDER', linker: partialDirectiveLinkerVersion1},
|
||||
{range: '>=11.1.0-next.1', linker: partialDirectiveLinkerVersion1},
|
||||
]);
|
||||
linkers.set(ɵɵngDeclareClassMetadata, [
|
||||
{range: '0.0.0-PLACEHOLDER', linker: partialClassMetadataLinkerVersion1},
|
||||
{range: '>=11.1.0-next.1', linker: partialClassMetadataLinkerVersion1},
|
||||
]);
|
||||
linkers.set(ɵɵngDeclareComponent, [
|
||||
{range: '0.0.0-PLACEHOLDER', linker: partialComponentLinkerVersion1},
|
||||
{range: '>=11.1.0-next.1', linker: partialComponentLinkerVersion1},
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {compileComponentFromMetadata, compileDeclareComponentFromMetadata, ConstantPool, CssSelector, DeclarationListEmitMode, DEFAULT_INTERPOLATION_CONFIG, DomElementSchemaRegistry, Expression, ExternalExpr, FactoryTarget, InterpolationConfig, LexerRange, makeBindingParser, ParsedTemplate, ParseSourceFile, parseTemplate, R3ComponentMetadata, R3FactoryMetadata, R3TargetBinder, R3UsedDirectiveMetadata, SelectorMatcher, Statement, TmplAstNode, WrappedNodeExpr} from '@angular/compiler';
|
||||
import {compileClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, ConstantPool, CssSelector, DeclarationListEmitMode, DEFAULT_INTERPOLATION_CONFIG, DomElementSchemaRegistry, Expression, ExternalExpr, FactoryTarget, InterpolationConfig, LexerRange, makeBindingParser, ParsedTemplate, ParseSourceFile, parseTemplate, R3ClassMetadata, R3ComponentMetadata, R3FactoryMetadata, R3TargetBinder, R3UsedDirectiveMetadata, SelectorMatcher, Statement, TmplAstNode, WrappedNodeExpr} from '@angular/compiler';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {Cycle, CycleAnalyzer, CycleHandlingStrategy} from '../../cycles';
|
||||
@@ -30,7 +30,7 @@ import {ResourceLoader} from './api';
|
||||
import {createValueHasWrongTypeError, getDirectiveDiagnostics, getProviderDiagnostics} from './diagnostics';
|
||||
import {DirectiveSymbol, extractDirectiveMetadata, parseFieldArrayValue} from './directive';
|
||||
import {compileDeclareFactory, compileNgFactoryDefField} from './factory';
|
||||
import {generateSetClassMetadataCall} from './metadata';
|
||||
import {extractClassMetadata} from './metadata';
|
||||
import {NgModuleSymbol} from './ng_module';
|
||||
import {compileResults, findAngularDecorator, isAngularCoreReference, isExpressionForwardReference, readBaseClass, resolveProvidersRequiringFactory, toFactoryMetadata, unwrapExpression, wrapFunctionExpressionsInParens} from './util';
|
||||
|
||||
@@ -55,7 +55,7 @@ export interface ComponentAnalysisData {
|
||||
baseClass: Reference<ClassDeclaration>|'dynamic'|null;
|
||||
typeCheckMeta: DirectiveTypeCheckMeta;
|
||||
template: ParsedTemplateWithSource;
|
||||
metadataStmt: Statement|null;
|
||||
classMetadata: R3ClassMetadata|null;
|
||||
|
||||
inputs: ClassPropertyMapping;
|
||||
outputs: ClassPropertyMapping;
|
||||
@@ -489,7 +489,7 @@ export class ComponentDecoratorHandler implements
|
||||
relativeContextFilePath,
|
||||
},
|
||||
typeCheckMeta: extractDirectiveTypeCheckMeta(node, inputs, this.reflector),
|
||||
metadataStmt: generateSetClassMetadataCall(
|
||||
classMetadata: extractClassMetadata(
|
||||
node, this.reflector, this.defaultImportRecorder, this.isCore,
|
||||
this.annotateForClosureCompiler),
|
||||
template,
|
||||
@@ -870,7 +870,10 @@ export class ComponentDecoratorHandler implements
|
||||
const meta: R3ComponentMetadata = {...analysis.meta, ...resolution};
|
||||
const fac = compileNgFactoryDefField(toFactoryMetadata(meta, FactoryTarget.Component));
|
||||
const def = compileComponentFromMetadata(meta, pool, makeBindingParser());
|
||||
return compileResults(fac, def, analysis.metadataStmt, 'ɵcmp');
|
||||
const classMetadata = analysis.classMetadata !== null ?
|
||||
compileClassMetadata(analysis.classMetadata).toStmt() :
|
||||
null;
|
||||
return compileResults(fac, def, classMetadata, 'ɵcmp');
|
||||
}
|
||||
|
||||
compilePartial(
|
||||
@@ -882,7 +885,10 @@ export class ComponentDecoratorHandler implements
|
||||
const meta: R3ComponentMetadata = {...analysis.meta, ...resolution};
|
||||
const fac = compileDeclareFactory(toFactoryMetadata(meta, FactoryTarget.Component));
|
||||
const def = compileDeclareComponentFromMetadata(meta, analysis.template);
|
||||
return compileResults(fac, def, analysis.metadataStmt, 'ɵcmp');
|
||||
const classMetadata = analysis.classMetadata !== null ?
|
||||
compileDeclareClassMetadata(analysis.classMetadata).toStmt() :
|
||||
null;
|
||||
return compileResults(fac, def, classMetadata, 'ɵcmp');
|
||||
}
|
||||
|
||||
private _resolveLiteral(decorator: Decorator): ts.ObjectLiteralExpression {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, ConstantPool, Expression, ExternalExpr, FactoryTarget, getSafePropertyAccessString, makeBindingParser, ParsedHostBindings, ParseError, parseHostBindings, R3DirectiveMetadata, R3FactoryMetadata, R3QueryMetadata, Statement, verifyHostBindings, WrappedNodeExpr} from '@angular/compiler';
|
||||
import {compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, ConstantPool, Expression, ExternalExpr, FactoryTarget, getSafePropertyAccessString, makeBindingParser, ParsedHostBindings, ParseError, parseHostBindings, R3ClassMetadata, R3DirectiveMetadata, R3FactoryMetadata, R3QueryMetadata, Statement, verifyHostBindings, WrappedNodeExpr} from '@angular/compiler';
|
||||
import {emitDistinctChangesOnlyDefaultValue} from '@angular/compiler/src/core';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
@@ -23,7 +23,7 @@ import {AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerFl
|
||||
|
||||
import {createValueHasWrongTypeError, getDirectiveDiagnostics, getProviderDiagnostics, getUndecoratedClassWithAngularFeaturesDiagnostic} from './diagnostics';
|
||||
import {compileDeclareFactory, compileNgFactoryDefField} from './factory';
|
||||
import {generateSetClassMetadataCall} from './metadata';
|
||||
import {extractClassMetadata} from './metadata';
|
||||
import {compileResults, createSourceSpan, findAngularDecorator, getConstructorDependencies, isAngularDecorator, readBaseClass, resolveProvidersRequiringFactory, toFactoryMetadata, tryUnwrapForwardRef, unwrapConstructorDependencies, unwrapExpression, validateConstructorDependencies, wrapFunctionExpressionsInParens, wrapTypeReference} from './util';
|
||||
|
||||
const EMPTY_OBJECT: {[key: string]: string} = {};
|
||||
@@ -40,7 +40,7 @@ export interface DirectiveHandlerData {
|
||||
baseClass: Reference<ClassDeclaration>|'dynamic'|null;
|
||||
typeCheckMeta: DirectiveTypeCheckMeta;
|
||||
meta: R3DirectiveMetadata;
|
||||
metadataStmt: Statement|null;
|
||||
classMetadata: R3ClassMetadata|null;
|
||||
providersRequiringFactory: Set<Reference<ClassDeclaration>>|null;
|
||||
inputs: ClassPropertyMapping;
|
||||
outputs: ClassPropertyMapping;
|
||||
@@ -233,7 +233,7 @@ export class DirectiveDecoratorHandler implements
|
||||
inputs: directiveResult.inputs,
|
||||
outputs: directiveResult.outputs,
|
||||
meta: analysis,
|
||||
metadataStmt: generateSetClassMetadataCall(
|
||||
classMetadata: extractClassMetadata(
|
||||
node, this.reflector, this.defaultImportRecorder, this.isCore,
|
||||
this.annotateForClosureCompiler),
|
||||
baseClass: readBaseClass(node, this.reflector, this.evaluator),
|
||||
@@ -304,7 +304,10 @@ export class DirectiveDecoratorHandler implements
|
||||
resolution: Readonly<unknown>, pool: ConstantPool): CompileResult[] {
|
||||
const fac = compileNgFactoryDefField(toFactoryMetadata(analysis.meta, FactoryTarget.Directive));
|
||||
const def = compileDirectiveFromMetadata(analysis.meta, pool, makeBindingParser());
|
||||
return compileResults(fac, def, analysis.metadataStmt, 'ɵdir');
|
||||
const classMetadata = analysis.classMetadata !== null ?
|
||||
compileClassMetadata(analysis.classMetadata).toStmt() :
|
||||
null;
|
||||
return compileResults(fac, def, classMetadata, 'ɵdir');
|
||||
}
|
||||
|
||||
compilePartial(
|
||||
@@ -312,7 +315,10 @@ export class DirectiveDecoratorHandler implements
|
||||
resolution: Readonly<unknown>): CompileResult[] {
|
||||
const fac = compileDeclareFactory(toFactoryMetadata(analysis.meta, FactoryTarget.Directive));
|
||||
const def = compileDeclareDirectiveFromMetadata(analysis.meta);
|
||||
return compileResults(fac, def, analysis.metadataStmt, 'ɵdir');
|
||||
const classMetadata = analysis.classMetadata !== null ?
|
||||
compileDeclareClassMetadata(analysis.classMetadata).toStmt() :
|
||||
null;
|
||||
return compileResults(fac, def, classMetadata, 'ɵdir');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {compileDeclareInjectableFromMetadata, compileInjectable, createR3ProviderExpression, Expression, FactoryTarget, LiteralExpr, R3CompiledExpression, R3DependencyMetadata, R3InjectableMetadata, R3ProviderExpression, Statement, WrappedNodeExpr} from '@angular/compiler';
|
||||
import {compileClassMetadata, CompileClassMetadataFn, compileDeclareClassMetadata, compileDeclareInjectableFromMetadata, compileInjectable, createR3ProviderExpression, Expression, FactoryTarget, LiteralExpr, R3ClassMetadata, R3CompiledExpression, R3DependencyMetadata, R3InjectableMetadata, R3ProviderExpression, Statement, WrappedNodeExpr} from '@angular/compiler';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {ErrorCode, FatalDiagnosticError} from '../../diagnostics';
|
||||
@@ -17,12 +17,12 @@ import {ClassDeclaration, Decorator, ReflectionHost, reflectObjectLiteral} from
|
||||
import {AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence} from '../../transform';
|
||||
|
||||
import {compileDeclareFactory, CompileFactoryFn, compileNgFactoryDefField} from './factory';
|
||||
import {generateSetClassMetadataCall} from './metadata';
|
||||
import {extractClassMetadata} from './metadata';
|
||||
import {findAngularDecorator, getConstructorDependencies, getValidConstructorDependencies, isAngularCore, toFactoryMetadata, tryUnwrapForwardRef, unwrapConstructorDependencies, validateConstructorDependencies, wrapTypeReference} from './util';
|
||||
|
||||
export interface InjectableHandlerData {
|
||||
meta: R3InjectableMetadata;
|
||||
metadataStmt: Statement|null;
|
||||
classMetadata: R3ClassMetadata|null;
|
||||
ctorDeps: R3DependencyMetadata[]|'invalid'|null;
|
||||
needsFactory: boolean;
|
||||
}
|
||||
@@ -76,8 +76,8 @@ export class InjectableDecoratorHandler implements
|
||||
ctorDeps: extractInjectableCtorDeps(
|
||||
node, meta, decorator, this.reflector, this.defaultImportRecorder, this.isCore,
|
||||
this.strictCtorDeps),
|
||||
metadataStmt: generateSetClassMetadataCall(
|
||||
node, this.reflector, this.defaultImportRecorder, this.isCore),
|
||||
classMetadata:
|
||||
extractClassMetadata(node, this.reflector, this.defaultImportRecorder, this.isCore),
|
||||
// Avoid generating multiple factories if a class has
|
||||
// more Angular decorators, apart from Injectable.
|
||||
needsFactory: !decorators ||
|
||||
@@ -96,27 +96,30 @@ export class InjectableDecoratorHandler implements
|
||||
|
||||
compileFull(node: ClassDeclaration, analysis: Readonly<InjectableHandlerData>): CompileResult[] {
|
||||
return this.compile(
|
||||
compileNgFactoryDefField, meta => compileInjectable(meta, false), node, analysis);
|
||||
compileNgFactoryDefField, meta => compileInjectable(meta, false), compileClassMetadata,
|
||||
node, analysis);
|
||||
}
|
||||
|
||||
compilePartial(node: ClassDeclaration, analysis: Readonly<InjectableHandlerData>):
|
||||
CompileResult[] {
|
||||
return this.compile(
|
||||
compileDeclareFactory, compileDeclareInjectableFromMetadata, node, analysis);
|
||||
compileDeclareFactory, compileDeclareInjectableFromMetadata, compileDeclareClassMetadata,
|
||||
node, analysis);
|
||||
}
|
||||
|
||||
private compile(
|
||||
compileFactoryFn: CompileFactoryFn,
|
||||
compileInjectableFn: (meta: R3InjectableMetadata) => R3CompiledExpression,
|
||||
node: ClassDeclaration, analysis: Readonly<InjectableHandlerData>): CompileResult[] {
|
||||
compileClassMetadataFn: CompileClassMetadataFn, node: ClassDeclaration,
|
||||
analysis: Readonly<InjectableHandlerData>): CompileResult[] {
|
||||
const results: CompileResult[] = [];
|
||||
|
||||
if (analysis.needsFactory) {
|
||||
const meta = analysis.meta;
|
||||
const factoryRes = compileFactoryFn(
|
||||
toFactoryMetadata({...meta, deps: analysis.ctorDeps}, FactoryTarget.Injectable));
|
||||
if (analysis.metadataStmt !== null) {
|
||||
factoryRes.statements.push(analysis.metadataStmt);
|
||||
if (analysis.classMetadata !== null) {
|
||||
factoryRes.statements.push(compileClassMetadataFn(analysis.classMetadata).toStmt());
|
||||
}
|
||||
results.push(factoryRes);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {devOnlyGuardedExpression, Expression, ExternalExpr, FunctionExpr, Identifiers, InvokeFunctionExpr, LiteralArrayExpr, LiteralExpr, literalMap, NONE_TYPE, ReturnStatement, Statement, WrappedNodeExpr} from '@angular/compiler';
|
||||
import {Expression, FunctionExpr, LiteralArrayExpr, LiteralExpr, literalMap, R3ClassMetadata, ReturnStatement, WrappedNodeExpr} from '@angular/compiler';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {DefaultImportRecorder} from '../../imports';
|
||||
@@ -14,7 +14,6 @@ import {CtorParameter, DeclarationNode, Decorator, ReflectionHost, TypeValueRefe
|
||||
|
||||
import {valueReferenceToExpression, wrapFunctionExpressionsInParens} from './util';
|
||||
|
||||
|
||||
/**
|
||||
* Given a class declaration, generate a call to `setClassMetadata` with the Angular metadata
|
||||
* present on the class or its member fields. An ngDevMode guard is used to allow the call to be
|
||||
@@ -23,10 +22,10 @@ import {valueReferenceToExpression, wrapFunctionExpressionsInParens} from './uti
|
||||
* If no such metadata is present, this function returns `null`. Otherwise, the call is returned
|
||||
* as a `Statement` for inclusion along with the class.
|
||||
*/
|
||||
export function generateSetClassMetadataCall(
|
||||
export function extractClassMetadata(
|
||||
clazz: DeclarationNode, reflection: ReflectionHost,
|
||||
defaultImportRecorder: DefaultImportRecorder, isCore: boolean,
|
||||
annotateForClosureCompiler?: boolean): Statement|null {
|
||||
annotateForClosureCompiler?: boolean): R3ClassMetadata|null {
|
||||
if (!reflection.isClass(clazz)) {
|
||||
return null;
|
||||
}
|
||||
@@ -50,10 +49,10 @@ export function generateSetClassMetadataCall(
|
||||
if (ngClassDecorators.length === 0) {
|
||||
return null;
|
||||
}
|
||||
const metaDecorators = ts.createArrayLiteral(ngClassDecorators);
|
||||
const metaDecorators = new WrappedNodeExpr(ts.createArrayLiteral(ngClassDecorators));
|
||||
|
||||
// Convert the constructor parameters to metadata, passing null if none are present.
|
||||
let metaCtorParameters: Expression = new LiteralExpr(null);
|
||||
let metaCtorParameters: Expression|null = null;
|
||||
const classCtorParameters = reflection.getConstructorParameters(clazz);
|
||||
if (classCtorParameters !== null) {
|
||||
const ctorParameters = classCtorParameters.map(
|
||||
@@ -64,7 +63,7 @@ export function generateSetClassMetadataCall(
|
||||
}
|
||||
|
||||
// Do the same for property decorators.
|
||||
let metaPropDecorators: ts.Expression = ts.createNull();
|
||||
let metaPropDecorators: Expression|null = null;
|
||||
const classMembers = reflection.getMembersOfClass(clazz).filter(
|
||||
member => !member.isStatic && member.decorators !== null && member.decorators.length > 0);
|
||||
const duplicateDecoratedMemberNames =
|
||||
@@ -80,22 +79,15 @@ export function generateSetClassMetadataCall(
|
||||
const decoratedMembers = classMembers.map(
|
||||
member => classMemberToMetadata(member.nameNode ?? member.name, member.decorators!, isCore));
|
||||
if (decoratedMembers.length > 0) {
|
||||
metaPropDecorators = ts.createObjectLiteral(decoratedMembers);
|
||||
metaPropDecorators = new WrappedNodeExpr(ts.createObjectLiteral(decoratedMembers));
|
||||
}
|
||||
|
||||
// Generate a pure call to setClassMetadata with the class identifier and its metadata.
|
||||
const setClassMetadata = new ExternalExpr(Identifiers.setClassMetadata);
|
||||
const fnCall = new InvokeFunctionExpr(
|
||||
/* fn */ setClassMetadata,
|
||||
/* args */
|
||||
[
|
||||
new WrappedNodeExpr(id),
|
||||
new WrappedNodeExpr(metaDecorators),
|
||||
metaCtorParameters,
|
||||
new WrappedNodeExpr(metaPropDecorators),
|
||||
]);
|
||||
const iife = new FunctionExpr([], [devOnlyGuardedExpression(fnCall).toStmt()]);
|
||||
return iife.callFn([]).toStmt();
|
||||
return {
|
||||
type: new WrappedNodeExpr(id),
|
||||
decorators: metaDecorators,
|
||||
ctorParameters: metaCtorParameters,
|
||||
propDecorators: metaPropDecorators,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, CUSTOM_ELEMENTS_SCHEMA, Expression, ExternalExpr, FactoryTarget, Identifiers as R3, InvokeFunctionExpr, LiteralArrayExpr, LiteralExpr, NO_ERRORS_SCHEMA, R3CompiledExpression, R3FactoryMetadata, R3Identifiers, R3InjectorMetadata, R3NgModuleMetadata, R3Reference, SchemaMetadata, Statement, STRING_TYPE, WrappedNodeExpr} from '@angular/compiler';
|
||||
import {compileClassMetadata, compileDeclareClassMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, CUSTOM_ELEMENTS_SCHEMA, Expression, ExternalExpr, FactoryTarget, Identifiers as R3, InvokeFunctionExpr, LiteralArrayExpr, LiteralExpr, NO_ERRORS_SCHEMA, R3ClassMetadata, R3CompiledExpression, R3FactoryMetadata, R3Identifiers, R3InjectorMetadata, R3NgModuleMetadata, R3Reference, SchemaMetadata, Statement, STRING_TYPE, WrappedNodeExpr} from '@angular/compiler';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {ErrorCode, FatalDiagnosticError, makeDiagnostic, makeRelatedInformation} from '../../diagnostics';
|
||||
@@ -24,7 +24,7 @@ import {getSourceFile} from '../../util/src/typescript';
|
||||
|
||||
import {createValueHasWrongTypeError, getProviderDiagnostics} from './diagnostics';
|
||||
import {compileDeclareFactory, compileNgFactoryDefField} from './factory';
|
||||
import {generateSetClassMetadataCall} from './metadata';
|
||||
import {extractClassMetadata} from './metadata';
|
||||
import {ReferencesRegistry} from './references_registry';
|
||||
import {combineResolvers, findAngularDecorator, forwardRefResolver, getValidConstructorDependencies, isExpressionForwardReference, resolveProvidersRequiringFactory, toR3Reference, unwrapExpression, wrapFunctionExpressionsInParens, wrapTypeReference} from './util';
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface NgModuleAnalysis {
|
||||
mod: R3NgModuleMetadata;
|
||||
inj: R3InjectorMetadata;
|
||||
fac: R3FactoryMetadata;
|
||||
metadataStmt: Statement|null;
|
||||
classMetadata: R3ClassMetadata|null;
|
||||
declarations: Reference<ClassDeclaration>[];
|
||||
rawDeclarations: ts.Expression|null;
|
||||
schemas: SchemaMetadata[];
|
||||
@@ -370,7 +370,7 @@ export class NgModuleDecoratorHandler implements
|
||||
providersRequiringFactory: rawProviders ?
|
||||
resolveProvidersRequiringFactory(rawProviders, this.reflector, this.evaluator) :
|
||||
null,
|
||||
metadataStmt: generateSetClassMetadataCall(
|
||||
classMetadata: extractClassMetadata(
|
||||
node, this.reflector, this.defaultImportRecorder, this.isCore,
|
||||
this.annotateForClosureCompiler),
|
||||
factorySymbolName: node.name.text,
|
||||
@@ -463,26 +463,28 @@ export class NgModuleDecoratorHandler implements
|
||||
|
||||
compileFull(
|
||||
node: ClassDeclaration,
|
||||
{inj, mod, fac, metadataStmt, declarations}: Readonly<NgModuleAnalysis>,
|
||||
{inj, mod, fac, classMetadata, declarations}: Readonly<NgModuleAnalysis>,
|
||||
{injectorImports}: Readonly<NgModuleResolution>): CompileResult[] {
|
||||
const factoryFn = compileNgFactoryDefField(fac);
|
||||
const ngInjectorDef = compileInjector(this.mergeInjectorImports(inj, injectorImports));
|
||||
const ngModuleDef = compileNgModule(mod);
|
||||
const statements = ngModuleDef.statements;
|
||||
this.insertMetadataStatement(statements, metadataStmt);
|
||||
const metadata = classMetadata !== null ? compileClassMetadata(classMetadata) : null;
|
||||
this.insertMetadataStatement(statements, metadata);
|
||||
this.appendRemoteScopingStatements(statements, node, declarations);
|
||||
|
||||
return this.compileNgModule(factoryFn, ngInjectorDef, ngModuleDef);
|
||||
}
|
||||
|
||||
compilePartial(
|
||||
node: ClassDeclaration, {inj, fac, mod, metadataStmt}: Readonly<NgModuleAnalysis>,
|
||||
node: ClassDeclaration, {inj, fac, mod, classMetadata}: Readonly<NgModuleAnalysis>,
|
||||
{injectorImports}: Readonly<NgModuleResolution>): CompileResult[] {
|
||||
const factoryFn = compileDeclareFactory(fac);
|
||||
const injectorDef =
|
||||
compileDeclareInjectorFromMetadata(this.mergeInjectorImports(inj, injectorImports));
|
||||
const ngModuleDef = compileDeclareNgModuleFromMetadata(mod);
|
||||
this.insertMetadataStatement(ngModuleDef.statements, metadataStmt);
|
||||
const metadata = classMetadata !== null ? compileDeclareClassMetadata(classMetadata) : null;
|
||||
this.insertMetadataStatement(ngModuleDef.statements, metadata);
|
||||
// NOTE: no remote scoping required as this is banned in partial compilation.
|
||||
return this.compileNgModule(factoryFn, injectorDef, ngModuleDef);
|
||||
}
|
||||
@@ -499,10 +501,10 @@ export class NgModuleDecoratorHandler implements
|
||||
/**
|
||||
* Add class metadata statements, if provided, to the `ngModuleStatements`.
|
||||
*/
|
||||
private insertMetadataStatement(ngModuleStatements: Statement[], metadataStmt: Statement|null):
|
||||
private insertMetadataStatement(ngModuleStatements: Statement[], metadata: Expression|null):
|
||||
void {
|
||||
if (metadataStmt !== null) {
|
||||
ngModuleStatements.unshift(metadataStmt);
|
||||
if (metadata !== null) {
|
||||
ngModuleStatements.unshift(metadata.toStmt());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget, R3PipeMetadata, Statement, WrappedNodeExpr} from '@angular/compiler';
|
||||
import {compileClassMetadata, compileDeclareClassMetadata, compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget, R3ClassMetadata, R3PipeMetadata, Statement, WrappedNodeExpr} from '@angular/compiler';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {ErrorCode, FatalDiagnosticError} from '../../diagnostics';
|
||||
@@ -21,12 +21,12 @@ import {AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerPr
|
||||
|
||||
import {createValueHasWrongTypeError} from './diagnostics';
|
||||
import {compileDeclareFactory, compileNgFactoryDefField} from './factory';
|
||||
import {generateSetClassMetadataCall} from './metadata';
|
||||
import {extractClassMetadata} from './metadata';
|
||||
import {compileResults, findAngularDecorator, getValidConstructorDependencies, makeDuplicateDeclarationError, toFactoryMetadata, unwrapExpression, wrapTypeReference} from './util';
|
||||
|
||||
export interface PipeHandlerData {
|
||||
meta: R3PipeMetadata;
|
||||
metadataStmt: Statement|null;
|
||||
classMetadata: R3ClassMetadata|null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -135,8 +135,8 @@ export class PipeDecoratorHandler implements
|
||||
clazz, this.reflector, this.defaultImportRecorder, this.isCore),
|
||||
pure,
|
||||
},
|
||||
metadataStmt: generateSetClassMetadataCall(
|
||||
clazz, this.reflector, this.defaultImportRecorder, this.isCore),
|
||||
classMetadata:
|
||||
extractClassMetadata(clazz, this.reflector, this.defaultImportRecorder, this.isCore),
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -167,12 +167,18 @@ export class PipeDecoratorHandler implements
|
||||
compileFull(node: ClassDeclaration, analysis: Readonly<PipeHandlerData>): CompileResult[] {
|
||||
const fac = compileNgFactoryDefField(toFactoryMetadata(analysis.meta, FactoryTarget.Pipe));
|
||||
const def = compilePipeFromMetadata(analysis.meta);
|
||||
return compileResults(fac, def, analysis.metadataStmt, 'ɵpipe');
|
||||
const classMetadata = analysis.classMetadata !== null ?
|
||||
compileClassMetadata(analysis.classMetadata).toStmt() :
|
||||
null;
|
||||
return compileResults(fac, def, classMetadata, 'ɵpipe');
|
||||
}
|
||||
|
||||
compilePartial(node: ClassDeclaration, analysis: Readonly<PipeHandlerData>): CompileResult[] {
|
||||
const fac = compileDeclareFactory(toFactoryMetadata(analysis.meta, FactoryTarget.Pipe));
|
||||
const def = compileDeclarePipeFromMetadata(analysis.meta);
|
||||
return compileResults(fac, def, analysis.metadataStmt, 'ɵpipe');
|
||||
const classMetadata = analysis.classMetadata !== null ?
|
||||
compileDeclareClassMetadata(analysis.classMetadata).toStmt() :
|
||||
null;
|
||||
return compileResults(fac, def, classMetadata, 'ɵpipe');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {compileClassMetadata} from '@angular/compiler';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
import {absoluteFrom, getSourceFileOrError} from '../../file_system';
|
||||
@@ -13,7 +14,7 @@ import {NOOP_DEFAULT_IMPORT_RECORDER, NoopImportRewriter} from '../../imports';
|
||||
import {TypeScriptReflectionHost} from '../../reflection';
|
||||
import {getDeclaration, makeProgram} from '../../testing';
|
||||
import {ImportManager, translateStatement} from '../../translator';
|
||||
import {generateSetClassMetadataCall} from '../src/metadata';
|
||||
import {extractClassMetadata} from '../src/metadata';
|
||||
|
||||
runInEachFileSystem(() => {
|
||||
describe('ngtsc setClassMetadata converter', () => {
|
||||
@@ -127,13 +128,14 @@ runInEachFileSystem(() => {
|
||||
{target: ts.ScriptTarget.ES2015});
|
||||
const host = new TypeScriptReflectionHost(program.getTypeChecker());
|
||||
const target = getDeclaration(program, _('/index.ts'), 'Target', ts.isClassDeclaration);
|
||||
const call = generateSetClassMetadataCall(target, host, NOOP_DEFAULT_IMPORT_RECORDER, false);
|
||||
const call = extractClassMetadata(target, host, NOOP_DEFAULT_IMPORT_RECORDER, false);
|
||||
if (call === null) {
|
||||
return '';
|
||||
}
|
||||
const sf = getSourceFileOrError(program, _('/index.ts'));
|
||||
const im = new ImportManager(new NoopImportRewriter(), 'i');
|
||||
const tsStatement = translateStatement(call, im);
|
||||
const stmt = compileClassMetadata(call).toStmt();
|
||||
const tsStatement = translateStatement(stmt, im);
|
||||
const res = ts.createPrinter().printNode(ts.EmitHint.Unspecified, tsStatement, sf);
|
||||
return res.replace(/\s+/g, ' ');
|
||||
}
|
||||
|
||||
+305
File diff suppressed because it is too large
Load Diff
+70
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"$schema": "../../test_case_schema.json",
|
||||
"cases": [
|
||||
{
|
||||
"description": "should capture Angular class decorators",
|
||||
"inputFiles": [
|
||||
"class_decorators.ts"
|
||||
],
|
||||
"expectations": [
|
||||
{
|
||||
"failureMessage": "Invalid class metadata",
|
||||
"files": [
|
||||
"class_decorators.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "should capture Angular property decorators",
|
||||
"inputFiles": [
|
||||
"property_decorators.ts"
|
||||
],
|
||||
"expectations": [
|
||||
{
|
||||
"failureMessage": "Invalid class metadata",
|
||||
"files": [
|
||||
"property_decorators.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "should capture constructor parameters",
|
||||
"inputFiles": [
|
||||
"parameter_decorators.ts"
|
||||
],
|
||||
"expectations": [
|
||||
{
|
||||
"failureMessage": "Invalid class metadata",
|
||||
"files": [
|
||||
{
|
||||
"expected": "parameter_decorators_custom.js",
|
||||
"generated": "parameter_decorators.js"
|
||||
},
|
||||
{
|
||||
"expected": "parameter_decorators_decorators.js",
|
||||
"generated": "parameter_decorators.js"
|
||||
},
|
||||
{
|
||||
"expected": "parameter_decorators_empty.js",
|
||||
"generated": "parameter_decorators.js"
|
||||
},
|
||||
{
|
||||
"expected": "parameter_decorators_no_ctor.js",
|
||||
"generated": "parameter_decorators.js"
|
||||
},
|
||||
{
|
||||
"expected": "parameter_decorators_no_decorators.js",
|
||||
"generated": "parameter_decorators.js"
|
||||
},
|
||||
{
|
||||
"expected": "parameter_decorators_derived.js",
|
||||
"generated": "parameter_decorators.js"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
BasicInjectable.ɵfac = …;
|
||||
BasicInjectable.ɵprov = …;
|
||||
(function () {
|
||||
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(BasicInjectable, [{
|
||||
type: Injectable
|
||||
}], null, null);
|
||||
})();
|
||||
|
||||
…
|
||||
|
||||
RootInjectable.ɵfac = …;
|
||||
RootInjectable.ɵprov = …;
|
||||
(function () {
|
||||
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(RootInjectable, [{
|
||||
type: Injectable,
|
||||
args: [{providedIn: 'root'}]
|
||||
}], null, null);
|
||||
})();
|
||||
|
||||
…
|
||||
|
||||
CustomInjectable.ɵfac = …;
|
||||
CustomInjectable.ɵprov = …;
|
||||
CustomInjectable = __decorate([
|
||||
CustomClassDecorator()
|
||||
], CustomInjectable);
|
||||
(function () {
|
||||
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(CustomInjectable, [{
|
||||
type: Injectable
|
||||
}], null, null);
|
||||
})();
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {CustomClassDecorator} from './custom';
|
||||
|
||||
@Injectable()
|
||||
export class BasicInjectable {
|
||||
}
|
||||
|
||||
@Injectable({providedIn: 'root'})
|
||||
export class RootInjectable {
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@CustomClassDecorator()
|
||||
class CustomInjectable {
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
export function CustomClassDecorator(): ClassDecorator {
|
||||
return (clazz) => clazz;
|
||||
}
|
||||
|
||||
export function CustomPropDecorator(): PropertyDecorator {
|
||||
return () => {};
|
||||
}
|
||||
|
||||
export function CustomParamDecorator(): ParameterDecorator {
|
||||
return () => {};
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
import {Inject, Injectable, InjectionToken, SkipSelf} from '@angular/core';
|
||||
import {CustomParamDecorator} from './custom';
|
||||
|
||||
export const TOKEN = new InjectionToken<string>('TOKEN');
|
||||
class Service {}
|
||||
|
||||
@Injectable()
|
||||
export class ParameterizedInjectable {
|
||||
constructor(
|
||||
service: Service, @Inject(TOKEN) token: string, @CustomParamDecorator() custom: Service,
|
||||
@Inject(TOKEN) @SkipSelf() @CustomParamDecorator() mixed: string) {}
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class NoCtor {
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class EmptyCtor {
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class NoDecorators {
|
||||
constructor(service: Service) {}
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class CustomInjectable {
|
||||
constructor(@CustomParamDecorator() service: Service) {}
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class DerivedInjectable extends ParameterizedInjectable {
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class DerivedInjectableWithCtor extends ParameterizedInjectable {
|
||||
constructor() {
|
||||
super(null!, '', null!, '');
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
CustomInjectable.ɵfac = …;
|
||||
CustomInjectable.ɵprov = …;
|
||||
(function () {
|
||||
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(CustomInjectable, [{
|
||||
type: Injectable
|
||||
}], function () {
|
||||
return [{
|
||||
type: Service,
|
||||
decorators: []
|
||||
}];
|
||||
}, null);
|
||||
})();
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
ParameterizedInjectable.ɵfac = …;
|
||||
ParameterizedInjectable.ɵprov = …;
|
||||
ParameterizedInjectable = __decorate([
|
||||
__param(2, CustomParamDecorator()),
|
||||
__param(3, CustomParamDecorator()),
|
||||
__metadata("design:paramtypes", [Service, String, Service, String])
|
||||
], ParameterizedInjectable);
|
||||
export {ParameterizedInjectable};
|
||||
(function () {
|
||||
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ParameterizedInjectable, [{
|
||||
type: Injectable
|
||||
}], function () {
|
||||
return [{type: Service}, {
|
||||
type: undefined, decorators: [{
|
||||
type: Inject,
|
||||
args: [TOKEN]
|
||||
}]
|
||||
}, {type: Service, decorators: []}, {
|
||||
type: undefined, decorators: [{
|
||||
type: Inject,
|
||||
args: [TOKEN]
|
||||
}, {
|
||||
type: SkipSelf
|
||||
}]
|
||||
}];
|
||||
}, null);
|
||||
})();
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
DerivedInjectable.ɵfac = …;
|
||||
DerivedInjectable.ɵprov = …;
|
||||
(function () {
|
||||
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(DerivedInjectable, [{
|
||||
type: Injectable
|
||||
}], null, null);
|
||||
})();
|
||||
|
||||
…
|
||||
|
||||
DerivedInjectableWithCtor.ɵfac = …;
|
||||
DerivedInjectableWithCtor.ɵprov = …;
|
||||
(function () {
|
||||
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(DerivedInjectableWithCtor, [{
|
||||
type: Injectable
|
||||
}], function () { return []; }, null);
|
||||
})();
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
EmptyCtor.ɵfac = …;
|
||||
EmptyCtor.ɵprov = …;
|
||||
(function () {
|
||||
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(EmptyCtor, [{
|
||||
type: Injectable
|
||||
}], function() { return []; }, null);
|
||||
})();
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
NoCtor.ɵfac = …;
|
||||
NoCtor.ɵprov = …;
|
||||
(function () {
|
||||
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(NoCtor, [{
|
||||
type: Injectable
|
||||
}], null, null);
|
||||
})();
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
NoDecorators.ɵfac = …;
|
||||
NoDecorators.ɵprov = …;
|
||||
(function () {
|
||||
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(NoDecorators, [{
|
||||
type: Injectable
|
||||
}], function () {
|
||||
return [{
|
||||
type: Service
|
||||
}];
|
||||
}, null);
|
||||
})();
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
MyDir.ɵfac = …;
|
||||
MyDir.ɵdir = …;
|
||||
__decorate([
|
||||
CustomPropDecorator(),
|
||||
__metadata("design:type", String)
|
||||
], MyDir.prototype, "custom", void 0);
|
||||
__decorate([
|
||||
CustomPropDecorator(),
|
||||
__metadata("design:type", String)
|
||||
], MyDir.prototype, "mixed", void 0);
|
||||
(function () {
|
||||
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(MyDir, [{
|
||||
type: Directive
|
||||
}], null, {
|
||||
foo: [{
|
||||
type: Input
|
||||
}], bar: [{
|
||||
type: Input,
|
||||
args: ['baz']
|
||||
}], custom: [], mixed: [{
|
||||
type: Input
|
||||
}, {
|
||||
type: Output
|
||||
}]
|
||||
});
|
||||
})();
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import {Directive, Input, Output} from '@angular/core';
|
||||
import {CustomPropDecorator} from './custom';
|
||||
|
||||
@Directive()
|
||||
export class MyDir {
|
||||
@Input() foo!: string;
|
||||
|
||||
@Input('baz') bar!: string;
|
||||
|
||||
@CustomPropDecorator() custom!: string;
|
||||
|
||||
@Input() @Output() @CustomPropDecorator() mixed!: string;
|
||||
|
||||
none!: string;
|
||||
}
|
||||
+118
-118
File diff suppressed because it is too large
Load Diff
+81
-81
@@ -7,42 +7,42 @@ export class SimpleComponent {
|
||||
}
|
||||
SimpleComponent.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: SimpleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
SimpleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: SimpleComponent, selector: "simple", ngImport: i0, template: '<div><ng-content></ng-content></div>', isInline: true });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SimpleComponent, [{
|
||||
type: Component,
|
||||
args: [{ selector: 'simple', template: '<div><ng-content></ng-content></div>' }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: SimpleComponent, decorators: [{
|
||||
type: Component,
|
||||
args: [{ selector: 'simple', template: '<div><ng-content></ng-content></div>' }]
|
||||
}] });
|
||||
export class ComplexComponent {
|
||||
}
|
||||
ComplexComponent.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ComplexComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
ComplexComponent.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: ComplexComponent, selector: "complex", ngImport: i0, template: `
|
||||
<div id="first"><ng-content select="span[title=toFirst]"></ng-content></div>
|
||||
<div id="second"><ng-content SELECT="span[title=toSecond]"></ng-content></div>`, isInline: true });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ComplexComponent, [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'complex',
|
||||
template: `
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ComplexComponent, decorators: [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'complex',
|
||||
template: `
|
||||
<div id="first"><ng-content select="span[title=toFirst]"></ng-content></div>
|
||||
<div id="second"><ng-content SELECT="span[title=toSecond]"></ng-content></div>`
|
||||
}]
|
||||
}], null, null); })();
|
||||
}]
|
||||
}] });
|
||||
export class MyApp {
|
||||
}
|
||||
MyApp.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyApp, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
MyApp.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: MyApp, selector: "my-app", ngImport: i0, template: '<simple>content</simple> <complex></complex>', isInline: true, components: [{ type: SimpleComponent, selector: "simple" }, { type: ComplexComponent, selector: "complex" }] });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyApp, [{
|
||||
type: Component,
|
||||
args: [{ selector: 'my-app', template: '<simple>content</simple> <complex></complex>' }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyApp, decorators: [{
|
||||
type: Component,
|
||||
args: [{ selector: 'my-app', template: '<simple>content</simple> <complex></complex>' }]
|
||||
}] });
|
||||
export class MyModule {
|
||||
}
|
||||
MyModule.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
MyModule.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, declarations: [SimpleComponent, ComplexComponent, MyApp] });
|
||||
MyModule.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyModule, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [SimpleComponent, ComplexComponent, MyApp] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [SimpleComponent, ComplexComponent, MyApp] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: root_template.d.ts
|
||||
@@ -79,25 +79,25 @@ Cmp.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: Cmp,
|
||||
<ng-content select="[spacer]"></ng-content>
|
||||
<ng-content></ng-content>
|
||||
`, isInline: true });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Cmp, [{
|
||||
type: Component,
|
||||
args: [{
|
||||
template: `
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: Cmp, decorators: [{
|
||||
type: Component,
|
||||
args: [{
|
||||
template: `
|
||||
<ng-content></ng-content>
|
||||
<ng-content select="[spacer]"></ng-content>
|
||||
<ng-content></ng-content>
|
||||
`,
|
||||
}]
|
||||
}], null, null); })();
|
||||
}]
|
||||
}] });
|
||||
class Module {
|
||||
}
|
||||
Module.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
Module.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: Module, declarations: [Cmp] });
|
||||
Module.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: Module });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Module, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [Cmp] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: Module, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [Cmp] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: multiple_wildcards.d.ts
|
||||
@@ -123,10 +123,10 @@ Cmp.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: Cmp,
|
||||
'*' selector: <ng-content></ng-content>
|
||||
</ng-template>
|
||||
`, isInline: true });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Cmp, [{
|
||||
type: Component,
|
||||
args: [{
|
||||
template: `
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: Cmp, decorators: [{
|
||||
type: Component,
|
||||
args: [{
|
||||
template: `
|
||||
<div id="second" *ngIf="visible">
|
||||
<ng-content SELECT="span[title=toFirst]"></ng-content>
|
||||
</div>
|
||||
@@ -137,17 +137,17 @@ Cmp.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: Cmp,
|
||||
'*' selector: <ng-content></ng-content>
|
||||
</ng-template>
|
||||
`,
|
||||
}]
|
||||
}], null, null); })();
|
||||
}]
|
||||
}] });
|
||||
class Module {
|
||||
}
|
||||
Module.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
Module.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: Module, declarations: [Cmp] });
|
||||
Module.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: Module });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Module, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [Cmp] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: Module, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [Cmp] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: nested_template.d.ts
|
||||
@@ -175,10 +175,10 @@ Cmp.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: Cmp,
|
||||
</ng-template>
|
||||
<ng-content select="[id=toMainAfter]"></ng-content>
|
||||
`, isInline: true });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Cmp, [{
|
||||
type: Component,
|
||||
args: [{
|
||||
template: `
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: Cmp, decorators: [{
|
||||
type: Component,
|
||||
args: [{
|
||||
template: `
|
||||
<ng-content select="[id=toMainBefore]"></ng-content>
|
||||
<ng-template>
|
||||
<ng-content select="[id=toTemplate]"></ng-content>
|
||||
@@ -191,17 +191,17 @@ Cmp.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: Cmp,
|
||||
</ng-template>
|
||||
<ng-content select="[id=toMainAfter]"></ng-content>
|
||||
`,
|
||||
}]
|
||||
}], null, null); })();
|
||||
}]
|
||||
}] });
|
||||
class Module {
|
||||
}
|
||||
Module.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
Module.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: Module, declarations: [Cmp] });
|
||||
Module.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: Module });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Module, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [Cmp] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: Module, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [Cmp] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: root_and_nested.d.ts
|
||||
@@ -217,27 +217,27 @@ export class SimpleComponent {
|
||||
}
|
||||
SimpleComponent.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: SimpleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
SimpleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: SimpleComponent, selector: "simple", ngImport: i0, template: '<div><ng-content select="[title]"></ng-content></div>', isInline: true });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SimpleComponent, [{
|
||||
type: Component,
|
||||
args: [{ selector: 'simple', template: '<div><ng-content select="[title]"></ng-content></div>' }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: SimpleComponent, decorators: [{
|
||||
type: Component,
|
||||
args: [{ selector: 'simple', template: '<div><ng-content select="[title]"></ng-content></div>' }]
|
||||
}] });
|
||||
export class MyApp {
|
||||
}
|
||||
MyApp.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyApp, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
MyApp.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: MyApp, selector: "my-app", ngImport: i0, template: '<simple><h1 ngProjectAs="[title]"></h1></simple>', isInline: true, components: [{ type: SimpleComponent, selector: "simple" }] });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyApp, [{
|
||||
type: Component,
|
||||
args: [{ selector: 'my-app', template: '<simple><h1 ngProjectAs="[title]"></h1></simple>' }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyApp, decorators: [{
|
||||
type: Component,
|
||||
args: [{ selector: 'my-app', template: '<simple><h1 ngProjectAs="[title]"></h1></simple>' }]
|
||||
}] });
|
||||
export class MyModule {
|
||||
}
|
||||
MyModule.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
MyModule.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, declarations: [MyApp, SimpleComponent] });
|
||||
MyModule.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyModule, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyApp, SimpleComponent] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyApp, SimpleComponent] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: ng_project_as_selector.d.ts
|
||||
@@ -266,27 +266,27 @@ export class SimpleComponent {
|
||||
}
|
||||
SimpleComponent.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: SimpleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
SimpleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: SimpleComponent, selector: "simple", ngImport: i0, template: '<div><ng-content select="[title]"></ng-content></div>', isInline: true });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SimpleComponent, [{
|
||||
type: Component,
|
||||
args: [{ selector: 'simple', template: '<div><ng-content select="[title]"></ng-content></div>' }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: SimpleComponent, decorators: [{
|
||||
type: Component,
|
||||
args: [{ selector: 'simple', template: '<div><ng-content select="[title]"></ng-content></div>' }]
|
||||
}] });
|
||||
export class MyApp {
|
||||
}
|
||||
MyApp.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyApp, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
MyApp.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: MyApp, selector: "my-app", ngImport: i0, template: '<simple><h1 ngProjectAs="[title],[header]"></h1></simple>', isInline: true, components: [{ type: SimpleComponent, selector: "simple" }] });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyApp, [{
|
||||
type: Component,
|
||||
args: [{ selector: 'my-app', template: '<simple><h1 ngProjectAs="[title],[header]"></h1></simple>' }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyApp, decorators: [{
|
||||
type: Component,
|
||||
args: [{ selector: 'my-app', template: '<simple><h1 ngProjectAs="[title],[header]"></h1></simple>' }]
|
||||
}] });
|
||||
export class MyModule {
|
||||
}
|
||||
MyModule.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
MyModule.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, declarations: [SimpleComponent, MyApp] });
|
||||
MyModule.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyModule, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [SimpleComponent, MyApp] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [SimpleComponent, MyApp] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: ng_project_as_compound_selector.d.ts
|
||||
@@ -318,10 +318,10 @@ export class MyApp {
|
||||
}
|
||||
MyApp.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyApp, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
MyApp.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: MyApp, selector: "my-app", ngImport: i0, template: '<div *ngIf="show" ngProjectAs=".someclass"></div>', isInline: true });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyApp, [{
|
||||
type: Component,
|
||||
args: [{ selector: 'my-app', template: '<div *ngIf="show" ngProjectAs=".someclass"></div>' }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyApp, decorators: [{
|
||||
type: Component,
|
||||
args: [{ selector: 'my-app', template: '<div *ngIf="show" ngProjectAs=".someclass"></div>' }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: ng_project_as_attribute.d.ts
|
||||
@@ -342,10 +342,10 @@ export class SimpleComponent {
|
||||
}
|
||||
SimpleComponent.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: SimpleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
SimpleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: SimpleComponent, selector: "simple", ngImport: i0, template: '<ng-content *ngIf="showContent"></ng-content>', isInline: true });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SimpleComponent, [{
|
||||
type: Component,
|
||||
args: [{ selector: 'simple', template: '<ng-content *ngIf="showContent"></ng-content>' }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: SimpleComponent, decorators: [{
|
||||
type: Component,
|
||||
args: [{ selector: 'simple', template: '<ng-content *ngIf="showContent"></ng-content>' }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: ng_content_with_structural_dir.d.ts
|
||||
|
||||
+52
-52
@@ -7,19 +7,19 @@ export class MyComponent {
|
||||
}
|
||||
MyComponent.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
MyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: MyComponent, selector: "my-component", ngImport: i0, template: '<input #user>Hello {{user.value}}!', isInline: true });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyComponent, [{
|
||||
type: Component,
|
||||
args: [{ selector: 'my-component', template: '<input #user>Hello {{user.value}}!' }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, decorators: [{
|
||||
type: Component,
|
||||
args: [{ selector: 'my-component', template: '<input #user>Hello {{user.value}}!' }]
|
||||
}] });
|
||||
export class MyModule {
|
||||
}
|
||||
MyModule.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
MyModule.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, declarations: [MyComponent] });
|
||||
MyModule.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyModule, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyComponent] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyComponent] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: local_reference.d.ts
|
||||
@@ -45,10 +45,10 @@ export class IfDirective {
|
||||
}
|
||||
IfDirective.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: IfDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
||||
IfDirective.ɵdir = i0.ɵɵngDeclareDirective({ version: "0.0.0-PLACEHOLDER", type: IfDirective, selector: "[if]", ngImport: i0 });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IfDirective, [{
|
||||
type: Directive,
|
||||
args: [{ selector: '[if]' }]
|
||||
}], function () { return [{ type: i0.TemplateRef }]; }, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: IfDirective, decorators: [{
|
||||
type: Directive,
|
||||
args: [{ selector: '[if]' }]
|
||||
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
||||
export class MyComponent {
|
||||
}
|
||||
MyComponent.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
@@ -62,11 +62,11 @@ MyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", ty
|
||||
</div>
|
||||
<div #baz></div>
|
||||
`, isInline: true, directives: [{ type: IfDirective, selector: "[if]" }] });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyComponent, [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'my-component',
|
||||
template: `
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, decorators: [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'my-component',
|
||||
template: `
|
||||
<div #foo></div>
|
||||
{{foo}}
|
||||
<div *if>
|
||||
@@ -76,17 +76,17 @@ MyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", ty
|
||||
</div>
|
||||
<div #baz></div>
|
||||
`
|
||||
}]
|
||||
}], null, null); })();
|
||||
}]
|
||||
}] });
|
||||
export class MyModule {
|
||||
}
|
||||
MyModule.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
MyModule.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, declarations: [IfDirective, MyComponent] });
|
||||
MyModule.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyModule, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [IfDirective, MyComponent] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [IfDirective, MyComponent] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: local_reference_nested.d.ts
|
||||
@@ -123,28 +123,28 @@ MyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", ty
|
||||
{{ foo }} - {{ item }}
|
||||
</span>
|
||||
</div>`, isInline: true });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyComponent, [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'my-component',
|
||||
template: `
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, decorators: [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'my-component',
|
||||
template: `
|
||||
<div *ngFor="let item of items">
|
||||
<div #foo></div>
|
||||
<span *ngIf="showing">
|
||||
{{ foo }} - {{ item }}
|
||||
</span>
|
||||
</div>`
|
||||
}]
|
||||
}], null, null); })();
|
||||
}]
|
||||
}] });
|
||||
export class MyModule {
|
||||
}
|
||||
MyModule.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
MyModule.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, declarations: [MyComponent] });
|
||||
MyModule.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyModule, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyComponent] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyComponent] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: local_reference_and_context_variables.d.ts
|
||||
@@ -194,13 +194,13 @@ export class LifecycleComp {
|
||||
}
|
||||
LifecycleComp.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: LifecycleComp, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
LifecycleComp.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: LifecycleComp, selector: "lifecycle-comp", inputs: { nameMin: ["name", "nameMin"] }, usesOnChanges: true, ngImport: i0, template: '', isInline: true });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LifecycleComp, [{
|
||||
type: Component,
|
||||
args: [{ selector: 'lifecycle-comp', template: '' }]
|
||||
}], null, { nameMin: [{
|
||||
type: Input,
|
||||
args: ['name']
|
||||
}] }); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: LifecycleComp, decorators: [{
|
||||
type: Component,
|
||||
args: [{ selector: 'lifecycle-comp', template: '' }]
|
||||
}], propDecorators: { nameMin: [{
|
||||
type: Input,
|
||||
args: ['name']
|
||||
}] } });
|
||||
export class SimpleLayout {
|
||||
constructor() {
|
||||
this.name1 = '1';
|
||||
@@ -212,25 +212,25 @@ SimpleLayout.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", t
|
||||
<lifecycle-comp [name]="name1"></lifecycle-comp>
|
||||
<lifecycle-comp [name]="name2"></lifecycle-comp>
|
||||
`, isInline: true, components: [{ type: LifecycleComp, selector: "lifecycle-comp", inputs: ["name"] }] });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SimpleLayout, [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'simple-layout',
|
||||
template: `
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: SimpleLayout, decorators: [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'simple-layout',
|
||||
template: `
|
||||
<lifecycle-comp [name]="name1"></lifecycle-comp>
|
||||
<lifecycle-comp [name]="name2"></lifecycle-comp>
|
||||
`
|
||||
}]
|
||||
}], null, null); })();
|
||||
}]
|
||||
}] });
|
||||
export class LifecycleModule {
|
||||
}
|
||||
LifecycleModule.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: LifecycleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
LifecycleModule.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: LifecycleModule, declarations: [LifecycleComp, SimpleLayout] });
|
||||
LifecycleModule.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: LifecycleModule });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LifecycleModule, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [LifecycleComp, SimpleLayout] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: LifecycleModule, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [LifecycleComp, SimpleLayout] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: lifecycle_hooks.d.ts
|
||||
|
||||
+55
-55
@@ -11,10 +11,10 @@ export class MyPipe {
|
||||
}
|
||||
MyPipe.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
||||
MyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyPipe, name: "myPipe", pure: false });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyPipe, [{
|
||||
type: Pipe,
|
||||
args: [{ name: 'myPipe', pure: false }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyPipe, decorators: [{
|
||||
type: Pipe,
|
||||
args: [{ name: 'myPipe', pure: false }]
|
||||
}] });
|
||||
export class MyPurePipe {
|
||||
transform(value, ...args) {
|
||||
return value;
|
||||
@@ -22,13 +22,13 @@ export class MyPurePipe {
|
||||
}
|
||||
MyPurePipe.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyPurePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
||||
MyPurePipe.ɵpipe = i0.ɵɵngDeclarePipe({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyPurePipe, name: "myPurePipe" });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyPurePipe, [{
|
||||
type: Pipe,
|
||||
args: [{
|
||||
name: 'myPurePipe',
|
||||
pure: true,
|
||||
}]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyPurePipe, decorators: [{
|
||||
type: Pipe,
|
||||
args: [{
|
||||
name: 'myPurePipe',
|
||||
pure: true,
|
||||
}]
|
||||
}] });
|
||||
export class MyApp {
|
||||
constructor() {
|
||||
this.name = 'World';
|
||||
@@ -37,22 +37,22 @@ export class MyApp {
|
||||
}
|
||||
MyApp.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyApp, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
MyApp.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: MyApp, selector: "my-app", ngImport: i0, template: '{{name | myPipe:size | myPurePipe:size }}<p>{{ name | myPipe:1:2:3:4:5 }} {{ name ? 1 : 2 | myPipe }}</p>', isInline: true, pipes: { "myPurePipe": MyPurePipe, "myPipe": MyPipe } });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyApp, [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'my-app',
|
||||
template: '{{name | myPipe:size | myPurePipe:size }}<p>{{ name | myPipe:1:2:3:4:5 }} {{ name ? 1 : 2 | myPipe }}</p>'
|
||||
}]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyApp, decorators: [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'my-app',
|
||||
template: '{{name | myPipe:size | myPurePipe:size }}<p>{{ name | myPipe:1:2:3:4:5 }} {{ name ? 1 : 2 | myPipe }}</p>'
|
||||
}]
|
||||
}] });
|
||||
export class MyModule {
|
||||
}
|
||||
MyModule.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
MyModule.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, declarations: [MyPipe, MyPurePipe, MyApp] });
|
||||
MyModule.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyModule, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyPipe, MyPurePipe, MyApp] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyPipe, MyPurePipe, MyApp] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: pipes.d.ts
|
||||
@@ -95,10 +95,10 @@ export class MyPipe {
|
||||
}
|
||||
MyPipe.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
||||
MyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyPipe, name: "myPipe", pure: false });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyPipe, [{
|
||||
type: Pipe,
|
||||
args: [{ name: 'myPipe', pure: false }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyPipe, decorators: [{
|
||||
type: Pipe,
|
||||
args: [{ name: 'myPipe', pure: false }]
|
||||
}] });
|
||||
export class MyApp {
|
||||
constructor() {
|
||||
this.name = '';
|
||||
@@ -106,22 +106,22 @@ export class MyApp {
|
||||
}
|
||||
MyApp.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyApp, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
MyApp.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: MyApp, selector: "my-app", ngImport: i0, template: '0:{{name | myPipe}}1:{{name | myPipe:1}}2:{{name | myPipe:1:2}}3:{{name | myPipe:1:2:3}}4:{{name | myPipe:1:2:3:4}}', isInline: true, pipes: { "myPipe": MyPipe } });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyApp, [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'my-app',
|
||||
template: '0:{{name | myPipe}}1:{{name | myPipe:1}}2:{{name | myPipe:1:2}}3:{{name | myPipe:1:2:3}}4:{{name | myPipe:1:2:3:4}}'
|
||||
}]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyApp, decorators: [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'my-app',
|
||||
template: '0:{{name | myPipe}}1:{{name | myPipe:1}}2:{{name | myPipe:1:2}}3:{{name | myPipe:1:2:3}}4:{{name | myPipe:1:2:3:4}}'
|
||||
}]
|
||||
}] });
|
||||
export class MyModule {
|
||||
}
|
||||
MyModule.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
MyModule.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, declarations: [MyPipe, MyApp] });
|
||||
MyModule.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyModule, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyPipe, MyApp] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyPipe, MyApp] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: pipe_invocation.d.ts
|
||||
@@ -158,10 +158,10 @@ export class MyPipe {
|
||||
}
|
||||
MyPipe.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyPipe, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Pipe });
|
||||
MyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyPipe, name: "myPipe" });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyPipe, [{
|
||||
type: Pipe,
|
||||
args: [{ name: 'myPipe' }]
|
||||
}], function () { return [{ type: i0.ChangeDetectorRef }]; }, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyPipe, decorators: [{
|
||||
type: Pipe,
|
||||
args: [{ name: 'myPipe' }]
|
||||
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
|
||||
export class MyOtherPipe {
|
||||
constructor(changeDetectorRef) { }
|
||||
transform(value, ...args) {
|
||||
@@ -170,12 +170,12 @@ export class MyOtherPipe {
|
||||
}
|
||||
MyOtherPipe.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyOtherPipe, deps: [{ token: i0.ChangeDetectorRef, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
|
||||
MyOtherPipe.ɵpipe = i0.ɵɵngDeclarePipe({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyOtherPipe, name: "myOtherPipe" });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyOtherPipe, [{
|
||||
type: Pipe,
|
||||
args: [{ name: 'myOtherPipe' }]
|
||||
}], function () { return [{ type: i0.ChangeDetectorRef, decorators: [{
|
||||
type: Optional
|
||||
}] }]; }, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyOtherPipe, decorators: [{
|
||||
type: Pipe,
|
||||
args: [{ name: 'myOtherPipe' }]
|
||||
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef, decorators: [{
|
||||
type: Optional
|
||||
}] }]; } });
|
||||
export class MyApp {
|
||||
constructor() {
|
||||
this.name = 'World';
|
||||
@@ -183,19 +183,19 @@ export class MyApp {
|
||||
}
|
||||
MyApp.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyApp, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
MyApp.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: MyApp, selector: "my-app", ngImport: i0, template: '{{name | myPipe }}<p>{{ name | myOtherPipe }}</p>', isInline: true, pipes: { "myPipe": MyPipe, "myOtherPipe": MyOtherPipe } });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyApp, [{
|
||||
type: Component,
|
||||
args: [{ selector: 'my-app', template: '{{name | myPipe }}<p>{{ name | myOtherPipe }}</p>' }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyApp, decorators: [{
|
||||
type: Component,
|
||||
args: [{ selector: 'my-app', template: '{{name | myPipe }}<p>{{ name | myOtherPipe }}</p>' }]
|
||||
}] });
|
||||
export class MyModule {
|
||||
}
|
||||
MyModule.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
MyModule.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, declarations: [MyPipe, MyOtherPipe, MyApp] });
|
||||
MyModule.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyModule, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyPipe, MyOtherPipe, MyApp] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyPipe, MyOtherPipe, MyApp] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: pipe_di_change_detector_ref.d.ts
|
||||
|
||||
+227
-227
File diff suppressed because it is too large
Load Diff
+57
-57
@@ -12,12 +12,12 @@ export class ForOfDirective {
|
||||
}
|
||||
ForOfDirective.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ForOfDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
||||
ForOfDirective.ɵdir = i0.ɵɵngDeclareDirective({ version: "0.0.0-PLACEHOLDER", type: ForOfDirective, selector: "[forOf]", inputs: { forOf: "forOf" }, usesOnChanges: true, ngImport: i0 });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ForOfDirective, [{
|
||||
type: Directive,
|
||||
args: [{ selector: '[forOf]' }]
|
||||
}], function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, { forOf: [{
|
||||
type: Input
|
||||
}] }); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ForOfDirective, decorators: [{
|
||||
type: Directive,
|
||||
args: [{ selector: '[forOf]' }]
|
||||
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { forOf: [{
|
||||
type: Input
|
||||
}] } });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: for_of.d.ts
|
||||
@@ -54,22 +54,22 @@ export class MyComponent {
|
||||
}
|
||||
MyComponent.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
MyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: MyComponent, selector: "my-component", ngImport: i0, template: `<svg><g *for="let item of items"><circle></circle></g></svg>`, isInline: true, directives: [{ type: i0.forwardRef(function () { return ForOfDirective; }), selector: "[forOf]", inputs: ["forOf"] }] });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyComponent, [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'my-component',
|
||||
template: `<svg><g *for="let item of items"><circle></circle></g></svg>`
|
||||
}]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, decorators: [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'my-component',
|
||||
template: `<svg><g *for="let item of items"><circle></circle></g></svg>`
|
||||
}]
|
||||
}] });
|
||||
export class MyModule {
|
||||
}
|
||||
MyModule.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
MyModule.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, declarations: [MyComponent, ForOfDirective] });
|
||||
MyModule.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyModule, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyComponent, ForOfDirective] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyComponent, ForOfDirective] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: svg_embedded_view.d.ts
|
||||
@@ -103,12 +103,12 @@ export class ForOfDirective {
|
||||
}
|
||||
ForOfDirective.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ForOfDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
||||
ForOfDirective.ɵdir = i0.ɵɵngDeclareDirective({ version: "0.0.0-PLACEHOLDER", type: ForOfDirective, selector: "[forOf]", inputs: { forOf: "forOf" }, usesOnChanges: true, ngImport: i0 });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ForOfDirective, [{
|
||||
type: Directive,
|
||||
args: [{ selector: '[forOf]' }]
|
||||
}], function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, { forOf: [{
|
||||
type: Input
|
||||
}] }); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ForOfDirective, decorators: [{
|
||||
type: Directive,
|
||||
args: [{ selector: '[forOf]' }]
|
||||
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { forOf: [{
|
||||
type: Input
|
||||
}] } });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: for_of.d.ts
|
||||
@@ -145,22 +145,22 @@ export class MyComponent {
|
||||
}
|
||||
MyComponent.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
MyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", type: MyComponent, selector: "my-component", ngImport: i0, template: `<ul><li *for="let item of items">{{item.name}}</li></ul>`, isInline: true, directives: [{ type: i0.forwardRef(function () { return ForOfDirective; }), selector: "[forOf]", inputs: ["forOf"] }] });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyComponent, [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'my-component',
|
||||
template: `<ul><li *for="let item of items">{{item.name}}</li></ul>`
|
||||
}]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, decorators: [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'my-component',
|
||||
template: `<ul><li *for="let item of items">{{item.name}}</li></ul>`
|
||||
}]
|
||||
}] });
|
||||
export class MyModule {
|
||||
}
|
||||
MyModule.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
MyModule.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, declarations: [MyComponent, ForOfDirective] });
|
||||
MyModule.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyModule, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyComponent, ForOfDirective] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyComponent, ForOfDirective] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: let_variable_and_reference.d.ts
|
||||
@@ -194,12 +194,12 @@ export class ForOfDirective {
|
||||
}
|
||||
ForOfDirective.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ForOfDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
||||
ForOfDirective.ɵdir = i0.ɵɵngDeclareDirective({ version: "0.0.0-PLACEHOLDER", type: ForOfDirective, selector: "[forOf]", inputs: { forOf: "forOf" }, usesOnChanges: true, ngImport: i0 });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ForOfDirective, [{
|
||||
type: Directive,
|
||||
args: [{ selector: '[forOf]' }]
|
||||
}], function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, { forOf: [{
|
||||
type: Input
|
||||
}] }); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ForOfDirective, decorators: [{
|
||||
type: Directive,
|
||||
args: [{ selector: '[forOf]' }]
|
||||
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { forOf: [{
|
||||
type: Input
|
||||
}] } });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: for_of.d.ts
|
||||
@@ -249,11 +249,11 @@ MyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", ty
|
||||
</ul>
|
||||
</li>
|
||||
</ul>`, isInline: true, directives: [{ type: i0.forwardRef(function () { return ForOfDirective; }), selector: "[forOf]", inputs: ["forOf"] }] });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyComponent, [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'my-component',
|
||||
template: `
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, decorators: [{
|
||||
type: Component,
|
||||
args: [{
|
||||
selector: 'my-component',
|
||||
template: `
|
||||
<ul>
|
||||
<li *for="let item of items">
|
||||
<div>{{item.name}}</div>
|
||||
@@ -264,17 +264,17 @@ MyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ version: "0.0.0-PLACEHOLDER", ty
|
||||
</ul>
|
||||
</li>
|
||||
</ul>`
|
||||
}]
|
||||
}], null, null); })();
|
||||
}]
|
||||
}] });
|
||||
export class MyModule {
|
||||
}
|
||||
MyModule.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
MyModule.ɵmod = i0.ɵɵngDeclareNgModule({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, declarations: [MyComponent, ForOfDirective] });
|
||||
MyModule.ɵinj = i0.ɵɵngDeclareInjector({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MyModule, [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyComponent, ForOfDirective] }]
|
||||
}], null, null); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{ declarations: [MyComponent, ForOfDirective] }]
|
||||
}] });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: parent_template_variable.d.ts
|
||||
@@ -311,12 +311,12 @@ export class ForOfDirective {
|
||||
}
|
||||
ForOfDirective.ɵfac = i0.ɵɵngDeclareFactory({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ForOfDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
||||
ForOfDirective.ɵdir = i0.ɵɵngDeclareDirective({ version: "0.0.0-PLACEHOLDER", type: ForOfDirective, selector: "[forOf]", inputs: { forOf: "forOf" }, usesOnChanges: true, ngImport: i0 });
|
||||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ForOfDirective, [{
|
||||
type: Directive,
|
||||
args: [{ selector: '[forOf]' }]
|
||||
}], function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, { forOf: [{
|
||||
type: Input
|
||||
}] }); })();
|
||||
i0.ɵɵngDeclareClassMetadata({ version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ForOfDirective, decorators: [{
|
||||
type: Directive,
|
||||
args: [{ selector: '[forOf]' }]
|
||||
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { forOf: [{
|
||||
type: Input
|
||||
}] } });
|
||||
|
||||
/****************************************************************************************************
|
||||
* PARTIAL FILE: for_of.d.ts
|
||||
|
||||
+148
-148
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user