refactor(core): rename ngFactoryDef to ɵfac (#33116)
Factory defs are not considered public API, so the property that contains them should be prefixed with Angular's marker for "private" ('ɵ') to discourage apps from relying on def APIs directly. This commit adds the prefix and shortens the name from ngFactoryDef to fac. This is because property names cannot be minified by Uglify without turning on property mangling (which most apps have turned off) and are thus size-sensitive. Note that the other "defs" (ngPipeDef, etc) will be prefixed and shortened in follow-up PRs, in an attempt to limit how large and conflict-y this change is. PR Close #33116
This commit is contained in:
parent
c3aaa5211e
commit
0de2a5e408
|
@ -18,7 +18,7 @@ export class TreeFunction {
|
||||||
data: TreeNode = emptyTree;
|
data: TreeNode = emptyTree;
|
||||||
|
|
||||||
/** @nocollapse */
|
/** @nocollapse */
|
||||||
static ngFactoryDef = () => new TreeFunction;
|
static ɵfac = () => new TreeFunction;
|
||||||
|
|
||||||
/** @nocollapse */
|
/** @nocollapse */
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
|
|
|
@ -64,7 +64,7 @@ export const ngClassFactoryDef = ngClassFactoryDef__PRE_R3__;
|
||||||
*/
|
*/
|
||||||
export class NgClassBase {
|
export class NgClassBase {
|
||||||
static ɵdir: any = ngClassDirectiveDef;
|
static ɵdir: any = ngClassDirectiveDef;
|
||||||
static ngFactoryDef: any = ngClassFactoryDef;
|
static ɵfac: any = ngClassFactoryDef;
|
||||||
|
|
||||||
constructor(protected _delegate: NgClassImpl) {}
|
constructor(protected _delegate: NgClassImpl) {}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ export const ngStyleFactoryDef = ngStyleDirectiveDef__PRE_R3__;
|
||||||
*/
|
*/
|
||||||
export class NgStyleBase {
|
export class NgStyleBase {
|
||||||
static ɵdir: any = ngStyleDirectiveDef;
|
static ɵdir: any = ngStyleDirectiveDef;
|
||||||
static ngFactory: any = ngStyleFactoryDef;
|
static ɵfac: any = ngStyleFactoryDef;
|
||||||
|
|
||||||
constructor(protected _delegate: NgStyleImpl) {}
|
constructor(protected _delegate: NgStyleImpl) {}
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ runInEachFileSystem(() => {
|
||||||
const typingsFile = result.find(f => f.path === _('/typings/file.d.ts')) !;
|
const typingsFile = result.find(f => f.path === _('/typings/file.d.ts')) !;
|
||||||
expect(typingsFile.contents)
|
expect(typingsFile.contents)
|
||||||
.toContain(
|
.toContain(
|
||||||
'foo(x: number): number;\n static ngFactoryDef: ɵngcc0.ɵɵFactoryDef<A>;\n static ɵdir: ɵngcc0.ɵɵDirectiveDefWithMeta');
|
'foo(x: number): number;\n static ɵfac: ɵngcc0.ɵɵFactoryDef<A>;\n static ɵdir: ɵngcc0.ɵɵDirectiveDefWithMeta');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render imports into typings files', () => {
|
it('should render imports into typings files', () => {
|
||||||
|
|
|
@ -188,7 +188,7 @@ runInEachFileSystem(() => {
|
||||||
decorationAnalyses, switchMarkerAnalyses, privateDeclarationsAnalyses);
|
decorationAnalyses, switchMarkerAnalyses, privateDeclarationsAnalyses);
|
||||||
const addDefinitionsSpy = testFormatter.addDefinitions as jasmine.Spy;
|
const addDefinitionsSpy = testFormatter.addDefinitions as jasmine.Spy;
|
||||||
expect(addDefinitionsSpy.calls.first().args[2])
|
expect(addDefinitionsSpy.calls.first().args[2])
|
||||||
.toEqual(`A.ngFactoryDef = function A_Factory(t) { return new (t || A)(); };
|
.toEqual(`A.ɵfac = function A_Factory(t) { return new (t || A)(); };
|
||||||
A.ɵcmp = ɵngcc0.ɵɵdefineComponent({ type: A, selectors: [["a"]], decls: 1, vars: 1, template: function A_Template(rf, ctx) { if (rf & 1) {
|
A.ɵcmp = ɵngcc0.ɵɵdefineComponent({ type: A, selectors: [["a"]], decls: 1, vars: 1, template: function A_Template(rf, ctx) { if (rf & 1) {
|
||||||
ɵngcc0.ɵɵtext(0);
|
ɵngcc0.ɵɵtext(0);
|
||||||
} if (rf & 2) {
|
} if (rf & 2) {
|
||||||
|
@ -229,7 +229,7 @@ A.ɵcmp = ɵngcc0.ɵɵdefineComponent({ type: A, selectors: [["a"]], decls: 1, v
|
||||||
}));
|
}));
|
||||||
|
|
||||||
expect(addDefinitionsSpy.calls.first().args[2])
|
expect(addDefinitionsSpy.calls.first().args[2])
|
||||||
.toEqual(`A.ngFactoryDef = function A_Factory(t) { return new (t || A)(); };
|
.toEqual(`A.ɵfac = function A_Factory(t) { return new (t || A)(); };
|
||||||
A.ɵdir = ɵngcc0.ɵɵdefineDirective({ type: A, selectors: [["", "a", ""]] });
|
A.ɵdir = ɵngcc0.ɵɵdefineDirective({ type: A, selectors: [["", "a", ""]] });
|
||||||
/*@__PURE__*/ ɵngcc0.ɵsetClassMetadata(A, [{
|
/*@__PURE__*/ ɵngcc0.ɵsetClassMetadata(A, [{
|
||||||
type: Directive,
|
type: Directive,
|
||||||
|
|
|
@ -12,10 +12,5 @@ import {CompileResult} from '../../transform';
|
||||||
|
|
||||||
export function compileNgFactoryDefField(metadata: R3FactoryDefMetadata): CompileResult {
|
export function compileNgFactoryDefField(metadata: R3FactoryDefMetadata): CompileResult {
|
||||||
const res = compileFactoryFromMetadata(metadata);
|
const res = compileFactoryFromMetadata(metadata);
|
||||||
return {
|
return {name: 'ɵfac', initializer: res.factory, statements: res.statements, type: res.type};
|
||||||
name: 'ngFactoryDef',
|
|
||||||
initializer: res.factory,
|
|
||||||
statements: res.statements,
|
|
||||||
type: res.type
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ const R3_DEF_NAME_PATTERN = [
|
||||||
'ngInjectorDef',
|
'ngInjectorDef',
|
||||||
'ngModuleDef',
|
'ngModuleDef',
|
||||||
'ngPipeDef',
|
'ngPipeDef',
|
||||||
'ngFactoryDef',
|
'ɵfac',
|
||||||
].join('|');
|
].join('|');
|
||||||
|
|
||||||
// Pattern matching `Identifier.property` where property is a Render3 property.
|
// Pattern matching `Identifier.property` where property is a Render3 property.
|
||||||
|
|
|
@ -44,7 +44,7 @@ describe('compiler compliance', () => {
|
||||||
|
|
||||||
// The factory should look like this:
|
// The factory should look like this:
|
||||||
const factory =
|
const factory =
|
||||||
'MyComponent.ngFactoryDef = function MyComponent_Factory(t) { return new (t || MyComponent)(); }';
|
'MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); }';
|
||||||
|
|
||||||
// The template should look like this (where IDENT is a wild card for an identifier):
|
// The template should look like this (where IDENT is a wild card for an identifier):
|
||||||
const template = `
|
const template = `
|
||||||
|
@ -93,7 +93,7 @@ describe('compiler compliance', () => {
|
||||||
|
|
||||||
// The factory should look like this:
|
// The factory should look like this:
|
||||||
const factory =
|
const factory =
|
||||||
'MyComponent.ngFactoryDef = function MyComponent_Factory(t) { return new (t || MyComponent)(); }';
|
'MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); }';
|
||||||
|
|
||||||
// The template should look like this (where IDENT is a wild card for an identifier):
|
// The template should look like this (where IDENT is a wild card for an identifier):
|
||||||
const template = `
|
const template = `
|
||||||
|
@ -141,7 +141,7 @@ describe('compiler compliance', () => {
|
||||||
|
|
||||||
// The factory should look like this:
|
// The factory should look like this:
|
||||||
const factory =
|
const factory =
|
||||||
'MyComponent.ngFactoryDef = function MyComponent_Factory(t) { return new (t || MyComponent)(); }';
|
'MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); }';
|
||||||
|
|
||||||
// The template should look like this (where IDENT is a wild card for an identifier):
|
// The template should look like this (where IDENT is a wild card for an identifier):
|
||||||
const template = `
|
const template = `
|
||||||
|
@ -189,7 +189,7 @@ describe('compiler compliance', () => {
|
||||||
|
|
||||||
// The factory should look like this:
|
// The factory should look like this:
|
||||||
const factory =
|
const factory =
|
||||||
'MyComponent.ngFactoryDef = function MyComponent_Factory(t) { return new (t || MyComponent)(); }';
|
'MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); }';
|
||||||
|
|
||||||
// The template should look like this (where IDENT is a wild card for an identifier):
|
// The template should look like this (where IDENT is a wild card for an identifier):
|
||||||
const template = `
|
const template = `
|
||||||
|
@ -305,7 +305,7 @@ describe('compiler compliance', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const factory =
|
const factory =
|
||||||
'MyComponent.ngFactoryDef = function MyComponent_Factory(t) { return new (t || MyComponent)(); }';
|
'MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); }';
|
||||||
const template = `
|
const template = `
|
||||||
…
|
…
|
||||||
consts: [[${AttributeMarker.Bindings}, "id"]],
|
consts: [[${AttributeMarker.Bindings}, "id"]],
|
||||||
|
@ -360,7 +360,7 @@ describe('compiler compliance', () => {
|
||||||
///////////////
|
///////////////
|
||||||
|
|
||||||
const factory =
|
const factory =
|
||||||
'MyComponent.ngFactoryDef = function MyComponent_Factory(t) { return new (t || MyComponent)(); }';
|
'MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); }';
|
||||||
const template = `
|
const template = `
|
||||||
template: function MyComponent_Template(rf, ctx) {
|
template: function MyComponent_Template(rf, ctx) {
|
||||||
if (rf & 1) {
|
if (rf & 1) {
|
||||||
|
@ -475,7 +475,7 @@ describe('compiler compliance', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const factory =
|
const factory =
|
||||||
'MyComponent.ngFactoryDef = function MyComponent_Factory(t) { return new (t || MyComponent)(); }';
|
'MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); }';
|
||||||
const template = `
|
const template = `
|
||||||
MyComponent.ɵcmp = i0.ɵɵdefineComponent({type:MyComponent,selectors:[["my-component"]],
|
MyComponent.ɵcmp = i0.ɵɵdefineComponent({type:MyComponent,selectors:[["my-component"]],
|
||||||
decls: 1,
|
decls: 1,
|
||||||
|
@ -579,7 +579,7 @@ describe('compiler compliance', () => {
|
||||||
});`;
|
});`;
|
||||||
|
|
||||||
const ChildComponentFactory =
|
const ChildComponentFactory =
|
||||||
`ChildComponent.ngFactoryDef = function ChildComponent_Factory(t) { return new (t || ChildComponent)(); };`;
|
`ChildComponent.ɵfac = function ChildComponent_Factory(t) { return new (t || ChildComponent)(); };`;
|
||||||
|
|
||||||
// SomeDirective definition should be:
|
// SomeDirective definition should be:
|
||||||
const SomeDirectiveDefinition = `
|
const SomeDirectiveDefinition = `
|
||||||
|
@ -590,7 +590,7 @@ describe('compiler compliance', () => {
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const SomeDirectiveFactory =
|
const SomeDirectiveFactory =
|
||||||
`SomeDirective.ngFactoryDef = function SomeDirective_Factory(t) {return new (t || SomeDirective)(); };`;
|
`SomeDirective.ɵfac = function SomeDirective_Factory(t) {return new (t || SomeDirective)(); };`;
|
||||||
|
|
||||||
// MyComponent definition should be:
|
// MyComponent definition should be:
|
||||||
const MyComponentDefinition = `
|
const MyComponentDefinition = `
|
||||||
|
@ -613,17 +613,17 @@ describe('compiler compliance', () => {
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const MyComponentFactory =
|
const MyComponentFactory =
|
||||||
`MyComponent.ngFactoryDef = function MyComponent_Factory(t) { return new (t || MyComponent)(); };`;
|
`MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); };`;
|
||||||
|
|
||||||
const result = compile(files, angularFiles);
|
const result = compile(files, angularFiles);
|
||||||
const source = result.source;
|
const source = result.source;
|
||||||
|
|
||||||
expectEmit(source, ChildComponentDefinition, 'Incorrect ChildComponent.ɵcmp');
|
expectEmit(source, ChildComponentDefinition, 'Incorrect ChildComponent.ɵcmp');
|
||||||
expectEmit(source, ChildComponentFactory, 'Incorrect ChildComponent.ngFactoryDef');
|
expectEmit(source, ChildComponentFactory, 'Incorrect ChildComponent.ɵfac');
|
||||||
expectEmit(source, SomeDirectiveDefinition, 'Incorrect SomeDirective.ɵdir');
|
expectEmit(source, SomeDirectiveDefinition, 'Incorrect SomeDirective.ɵdir');
|
||||||
expectEmit(source, SomeDirectiveFactory, 'Incorrect SomeDirective.ngFactoryDef');
|
expectEmit(source, SomeDirectiveFactory, 'Incorrect SomeDirective.ɵfac');
|
||||||
expectEmit(source, MyComponentDefinition, 'Incorrect MyComponentDefinition.ɵcmp');
|
expectEmit(source, MyComponentDefinition, 'Incorrect MyComponentDefinition.ɵcmp');
|
||||||
expectEmit(source, MyComponentFactory, 'Incorrect MyComponentDefinition.ngFactoryDef');
|
expectEmit(source, MyComponentFactory, 'Incorrect MyComponentDefinition.ɵfac');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should support complex selectors', () => {
|
it('should support complex selectors', () => {
|
||||||
|
@ -653,7 +653,7 @@ describe('compiler compliance', () => {
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const SomeDirectiveFactory =
|
const SomeDirectiveFactory =
|
||||||
`SomeDirective.ngFactoryDef = function SomeDirective_Factory(t) {return new (t || SomeDirective)(); };`;
|
`SomeDirective.ɵfac = function SomeDirective_Factory(t) {return new (t || SomeDirective)(); };`;
|
||||||
|
|
||||||
// OtherDirective definition should be:
|
// OtherDirective definition should be:
|
||||||
const OtherDirectiveDefinition = `
|
const OtherDirectiveDefinition = `
|
||||||
|
@ -664,15 +664,15 @@ describe('compiler compliance', () => {
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const OtherDirectiveFactory =
|
const OtherDirectiveFactory =
|
||||||
`OtherDirective.ngFactoryDef = function OtherDirective_Factory(t) {return new (t || OtherDirective)(); };`;
|
`OtherDirective.ɵfac = function OtherDirective_Factory(t) {return new (t || OtherDirective)(); };`;
|
||||||
|
|
||||||
const result = compile(files, angularFiles);
|
const result = compile(files, angularFiles);
|
||||||
const source = result.source;
|
const source = result.source;
|
||||||
|
|
||||||
expectEmit(source, SomeDirectiveDefinition, 'Incorrect SomeDirective.ɵdir');
|
expectEmit(source, SomeDirectiveDefinition, 'Incorrect SomeDirective.ɵdir');
|
||||||
expectEmit(source, SomeDirectiveFactory, 'Incorrect SomeDirective.ngFactoryDef');
|
expectEmit(source, SomeDirectiveFactory, 'Incorrect SomeDirective.ɵfac');
|
||||||
expectEmit(source, OtherDirectiveDefinition, 'Incorrect OtherDirective.ɵdir');
|
expectEmit(source, OtherDirectiveDefinition, 'Incorrect OtherDirective.ɵdir');
|
||||||
expectEmit(source, OtherDirectiveFactory, 'Incorrect OtherDirective.ngFactoryDef');
|
expectEmit(source, OtherDirectiveFactory, 'Incorrect OtherDirective.ɵfac');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should support components without selector', () => {
|
it('should support components without selector', () => {
|
||||||
|
@ -708,14 +708,13 @@ describe('compiler compliance', () => {
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const EmptyOutletComponentFactory =
|
const EmptyOutletComponentFactory =
|
||||||
`EmptyOutletComponent.ngFactoryDef = function EmptyOutletComponent_Factory(t) { return new (t || EmptyOutletComponent)(); };`;
|
`EmptyOutletComponent.ɵfac = function EmptyOutletComponent_Factory(t) { return new (t || EmptyOutletComponent)(); };`;
|
||||||
|
|
||||||
const result = compile(files, angularFiles);
|
const result = compile(files, angularFiles);
|
||||||
const source = result.source;
|
const source = result.source;
|
||||||
|
|
||||||
expectEmit(source, EmptyOutletComponentDefinition, 'Incorrect EmptyOutletComponent.ɵcmp');
|
expectEmit(source, EmptyOutletComponentDefinition, 'Incorrect EmptyOutletComponent.ɵcmp');
|
||||||
expectEmit(
|
expectEmit(source, EmptyOutletComponentFactory, 'Incorrect EmptyOutletComponent.ɵfac');
|
||||||
source, EmptyOutletComponentFactory, 'Incorrect EmptyOutletComponent.ngFactoryDef');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not treat ElementRef, ViewContainerRef, or ChangeDetectorRef specially when injecting',
|
it('should not treat ElementRef, ViewContainerRef, or ChangeDetectorRef specially when injecting',
|
||||||
|
@ -750,7 +749,7 @@ describe('compiler compliance', () => {
|
||||||
encapsulation: 2
|
encapsulation: 2
|
||||||
});`;
|
});`;
|
||||||
|
|
||||||
const MyComponentFactory = `MyComponent.ngFactoryDef = function MyComponent_Factory(t) {
|
const MyComponentFactory = `MyComponent.ɵfac = function MyComponent_Factory(t) {
|
||||||
return new (t || MyComponent)(
|
return new (t || MyComponent)(
|
||||||
$r3$.ɵɵdirectiveInject($i$.ElementRef), $r3$.ɵɵdirectiveInject($i$.ViewContainerRef),
|
$r3$.ɵɵdirectiveInject($i$.ElementRef), $r3$.ɵɵdirectiveInject($i$.ViewContainerRef),
|
||||||
$r3$.ɵɵdirectiveInject($i$.ChangeDetectorRef));
|
$r3$.ɵɵdirectiveInject($i$.ChangeDetectorRef));
|
||||||
|
@ -760,7 +759,7 @@ describe('compiler compliance', () => {
|
||||||
const source = result.source;
|
const source = result.source;
|
||||||
|
|
||||||
expectEmit(source, MyComponentDefinition, 'Incorrect MyComponent.ɵcmp');
|
expectEmit(source, MyComponentDefinition, 'Incorrect MyComponent.ɵcmp');
|
||||||
expectEmit(source, MyComponentFactory, 'Incorrect MyComponent.ngFactoryDef');
|
expectEmit(source, MyComponentFactory, 'Incorrect MyComponent.ɵfac');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should support structural directives', () => {
|
it('should support structural directives', () => {
|
||||||
|
@ -794,7 +793,7 @@ describe('compiler compliance', () => {
|
||||||
selectors: [["", "if", ""]]
|
selectors: [["", "if", ""]]
|
||||||
});`;
|
});`;
|
||||||
const IfDirectiveFactory =
|
const IfDirectiveFactory =
|
||||||
`IfDirective.ngFactoryDef = function IfDirective_Factory(t) { return new (t || IfDirective)($r3$.ɵɵdirectiveInject($i$.TemplateRef)); };`;
|
`IfDirective.ɵfac = function IfDirective_Factory(t) { return new (t || IfDirective)($r3$.ɵɵdirectiveInject($i$.TemplateRef)); };`;
|
||||||
|
|
||||||
const MyComponentDefinition = `
|
const MyComponentDefinition = `
|
||||||
const $c1$ = ["foo", ""];
|
const $c1$ = ["foo", ""];
|
||||||
|
@ -830,15 +829,15 @@ describe('compiler compliance', () => {
|
||||||
});`;
|
});`;
|
||||||
|
|
||||||
const MyComponentFactory =
|
const MyComponentFactory =
|
||||||
`MyComponent.ngFactoryDef = function MyComponent_Factory(t) { return new (t || MyComponent)(); };`;
|
`MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); };`;
|
||||||
|
|
||||||
const result = compile(files, angularFiles);
|
const result = compile(files, angularFiles);
|
||||||
const source = result.source;
|
const source = result.source;
|
||||||
|
|
||||||
expectEmit(source, IfDirectiveDefinition, 'Incorrect IfDirective.ɵdir');
|
expectEmit(source, IfDirectiveDefinition, 'Incorrect IfDirective.ɵdir');
|
||||||
expectEmit(source, IfDirectiveFactory, 'Incorrect IfDirective.ngFactoryDef');
|
expectEmit(source, IfDirectiveFactory, 'Incorrect IfDirective.ɵfac');
|
||||||
expectEmit(source, MyComponentDefinition, 'Incorrect MyComponent.ɵcmp');
|
expectEmit(source, MyComponentDefinition, 'Incorrect MyComponent.ɵcmp');
|
||||||
expectEmit(source, MyComponentFactory, 'Incorrect MyComponent.ngFactoryDef');
|
expectEmit(source, MyComponentFactory, 'Incorrect MyComponent.ɵfac');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('value composition', () => {
|
describe('value composition', () => {
|
||||||
|
@ -2024,8 +2023,8 @@ describe('compiler compliance', () => {
|
||||||
});
|
});
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const MyPipengFactoryDef = `
|
const MyPipeFactoryDef = `
|
||||||
MyPipe.ngFactoryDef = function MyPipe_Factory(t) { return new (t || MyPipe)(); };
|
MyPipe.ɵfac = function MyPipe_Factory(t) { return new (t || MyPipe)(); };
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const MyPurePipeDefinition = `
|
const MyPurePipeDefinition = `
|
||||||
|
@ -2035,8 +2034,8 @@ describe('compiler compliance', () => {
|
||||||
pure: true
|
pure: true
|
||||||
});`;
|
});`;
|
||||||
|
|
||||||
const MyPurePipengFactoryDef = `
|
const MyPurePipeFactoryDef = `
|
||||||
MyPurePipe.ngFactoryDef = function MyPurePipe_Factory(t) { return new (t || MyPurePipe)(); };
|
MyPurePipe.ɵfac = function MyPurePipe_Factory(t) { return new (t || MyPurePipe)(); };
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const MyAppDefinition = `
|
const MyAppDefinition = `
|
||||||
|
@ -2074,9 +2073,9 @@ describe('compiler compliance', () => {
|
||||||
const source = result.source;
|
const source = result.source;
|
||||||
|
|
||||||
expectEmit(source, MyPipeDefinition, 'Invalid pipe definition');
|
expectEmit(source, MyPipeDefinition, 'Invalid pipe definition');
|
||||||
expectEmit(source, MyPipengFactoryDef, 'Invalid pipe factory function');
|
expectEmit(source, MyPipeFactoryDef, 'Invalid pipe factory function');
|
||||||
expectEmit(source, MyPurePipeDefinition, 'Invalid pure pipe definition');
|
expectEmit(source, MyPurePipeDefinition, 'Invalid pure pipe definition');
|
||||||
expectEmit(source, MyPurePipengFactoryDef, 'Invalid pure pipe factory function');
|
expectEmit(source, MyPurePipeFactoryDef, 'Invalid pure pipe factory function');
|
||||||
expectEmit(source, MyAppDefinition, 'Invalid MyApp definition');
|
expectEmit(source, MyAppDefinition, 'Invalid MyApp definition');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2191,7 +2190,7 @@ describe('compiler compliance', () => {
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const MyPipeFactory = `
|
const MyPipeFactory = `
|
||||||
MyPipe.ngFactoryDef = function MyPipe_Factory(t) { return new (t || MyPipe)($r3$.ɵɵinjectPipeChangeDetectorRef()); };
|
MyPipe.ɵfac = function MyPipe_Factory(t) { return new (t || MyPipe)($r3$.ɵɵinjectPipeChangeDetectorRef()); };
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const MyOtherPipeDefinition = `
|
const MyOtherPipeDefinition = `
|
||||||
|
@ -2202,7 +2201,7 @@ describe('compiler compliance', () => {
|
||||||
});`;
|
});`;
|
||||||
|
|
||||||
const MyOtherPipeFactory = `
|
const MyOtherPipeFactory = `
|
||||||
MyOtherPipe.ngFactoryDef = function MyOtherPipe_Factory(t) { return new (t || MyOtherPipe)($r3$.ɵɵinjectPipeChangeDetectorRef(8)); };
|
MyOtherPipe.ɵfac = function MyOtherPipe_Factory(t) { return new (t || MyOtherPipe)($r3$.ɵɵinjectPipeChangeDetectorRef(8)); };
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const result = compile(files, angularFiles);
|
const result = compile(files, angularFiles);
|
||||||
|
@ -2603,8 +2602,7 @@ describe('compiler compliance', () => {
|
||||||
});
|
});
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const ForDirectiveFactory =
|
const ForDirectiveFactory = `ForOfDirective.ɵfac = function ForOfDirective_Factory(t) {
|
||||||
`ForOfDirective.ngFactoryDef = function ForOfDirective_Factory(t) {
|
|
||||||
return new (t || ForOfDirective)($r3$.ɵɵdirectiveInject(ViewContainerRef), $r3$.ɵɵdirectiveInject(TemplateRef));
|
return new (t || ForOfDirective)($r3$.ɵɵdirectiveInject(ViewContainerRef), $r3$.ɵɵdirectiveInject(TemplateRef));
|
||||||
};`;
|
};`;
|
||||||
|
|
||||||
|
@ -2685,7 +2683,7 @@ describe('compiler compliance', () => {
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const ForDirectiveFactory = `
|
const ForDirectiveFactory = `
|
||||||
ForOfDirective.ngFactoryDef = function ForOfDirective_Factory(t) {
|
ForOfDirective.ɵfac = function ForOfDirective_Factory(t) {
|
||||||
return new (t || ForOfDirective)($r3$.ɵɵdirectiveInject(ViewContainerRef), $r3$.ɵɵdirectiveInject(TemplateRef));
|
return new (t || ForOfDirective)($r3$.ɵɵdirectiveInject(ViewContainerRef), $r3$.ɵɵdirectiveInject(TemplateRef));
|
||||||
};
|
};
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -48,7 +48,7 @@ describe('compiler compliance: dependency injection', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const factory = `
|
const factory = `
|
||||||
MyComponent.ngFactoryDef = function MyComponent_Factory(t) {
|
MyComponent.ɵfac = function MyComponent_Factory(t) {
|
||||||
return new (t || MyComponent)(
|
return new (t || MyComponent)(
|
||||||
$r3$.ɵɵinjectAttribute('name'),
|
$r3$.ɵɵinjectAttribute('name'),
|
||||||
$r3$.ɵɵdirectiveInject(MyService),
|
$r3$.ɵɵdirectiveInject(MyService),
|
||||||
|
@ -83,7 +83,7 @@ describe('compiler compliance: dependency injection', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const factory = `
|
const factory = `
|
||||||
MyService.ngFactoryDef = function MyService_Factory(t) {
|
MyService.ɵfac = function MyService_Factory(t) {
|
||||||
return new (t || MyService)($r3$.ɵɵinject(MyDependency));
|
return new (t || MyService)($r3$.ɵɵinject(MyDependency));
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ describe('compiler compliance: dependency injection', () => {
|
||||||
MyService.ngInjectableDef = $r3$.ɵɵdefineInjectable({
|
MyService.ngInjectableDef = $r3$.ɵɵdefineInjectable({
|
||||||
token: MyService,
|
token: MyService,
|
||||||
factory: function(t) {
|
factory: function(t) {
|
||||||
return MyService.ngFactoryDef(t);
|
return MyService.ɵfac(t);
|
||||||
},
|
},
|
||||||
providedIn: null
|
providedIn: null
|
||||||
});
|
});
|
||||||
|
@ -102,7 +102,7 @@ describe('compiler compliance: dependency injection', () => {
|
||||||
expectEmit(result.source, def, 'Incorrect injectable definition');
|
expectEmit(result.source, def, 'Incorrect injectable definition');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create a single ngFactoryDef if the class has more than one decorator', () => {
|
it('should create a single factory def if the class has more than one decorator', () => {
|
||||||
const files = {
|
const files = {
|
||||||
app: {
|
app: {
|
||||||
'spec.ts': `
|
'spec.ts': `
|
||||||
|
@ -117,7 +117,7 @@ describe('compiler compliance: dependency injection', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const result = compile(files, angularFiles).source;
|
const result = compile(files, angularFiles).source;
|
||||||
const matches = result.match(/MyPipe\.ngFactoryDef = function MyPipe_Factory/g);
|
const matches = result.match(/MyPipe\.ɵfac = function MyPipe_Factory/g);
|
||||||
expect(matches ? matches.length : 0).toBe(1);
|
expect(matches ? matches.length : 0).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ describe('compiler compliance: dependency injection', () => {
|
||||||
MyService.ngInjectableDef = $r3$.ɵɵdefineInjectable({
|
MyService.ngInjectableDef = $r3$.ɵɵdefineInjectable({
|
||||||
token: MyService,
|
token: MyService,
|
||||||
factory: function(t) {
|
factory: function(t) {
|
||||||
return MyAlternateService.ngFactoryDef(t);
|
return MyAlternateService.ɵfac(t);
|
||||||
},
|
},
|
||||||
providedIn: null
|
providedIn: null
|
||||||
});
|
});
|
||||||
|
@ -293,7 +293,7 @@ describe('compiler compliance: dependency injection', () => {
|
||||||
SomeProvider.ngInjectableDef = $r3$.ɵɵdefineInjectable({
|
SomeProvider.ngInjectableDef = $r3$.ɵɵdefineInjectable({
|
||||||
token: SomeProvider,
|
token: SomeProvider,
|
||||||
factory: function(t) {
|
factory: function(t) {
|
||||||
return SomeProviderImpl.ngFactoryDef(t);
|
return SomeProviderImpl.ɵfac(t);
|
||||||
},
|
},
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
});
|
});
|
||||||
|
@ -343,17 +343,17 @@ describe('compiler compliance: dependency injection', () => {
|
||||||
const source = result.source;
|
const source = result.source;
|
||||||
|
|
||||||
const MyPipeFactory = `
|
const MyPipeFactory = `
|
||||||
MyPipe.ngFactoryDef = function MyPipe_Factory(t) { return new (t || MyPipe)($r3$.ɵɵdirectiveInject(Service)); };
|
MyPipe.ɵfac = function MyPipe_Factory(t) { return new (t || MyPipe)($r3$.ɵɵdirectiveInject(Service)); };
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const MyOtherPipeFactory = `
|
const MyOtherPipeFactory = `
|
||||||
MyOtherPipe.ngFactoryDef = function MyOtherPipe_Factory(t) { return new (t || MyOtherPipe)($r3$.ɵɵdirectiveInject(Service)); };
|
MyOtherPipe.ɵfac = function MyOtherPipe_Factory(t) { return new (t || MyOtherPipe)($r3$.ɵɵdirectiveInject(Service)); };
|
||||||
`;
|
`;
|
||||||
|
|
||||||
expectEmit(source, MyPipeFactory, 'Invalid pipe factory function');
|
expectEmit(source, MyPipeFactory, 'Invalid pipe factory function');
|
||||||
expectEmit(source, MyOtherPipeFactory, 'Invalid pipe factory function');
|
expectEmit(source, MyOtherPipeFactory, 'Invalid pipe factory function');
|
||||||
expect(source.match(/MyPipe\.ngFactoryDef =/g) !.length).toBe(1);
|
expect(source.match(/MyPipe\.ɵfac =/g) !.length).toBe(1);
|
||||||
expect(source.match(/MyOtherPipe\.ngFactoryDef =/g) !.length).toBe(1);
|
expect(source.match(/MyOtherPipe\.ɵfac =/g) !.length).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -53,14 +53,14 @@ describe('compiler compliance: directives', () => {
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const MyComponentFactory = `
|
const MyComponentFactory = `
|
||||||
MyComponent.ngFactoryDef = function MyComponent_Factory(t) { return new (t || MyComponent)(); };
|
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); };
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const result = compile(files, angularFiles);
|
const result = compile(files, angularFiles);
|
||||||
const source = result.source;
|
const source = result.source;
|
||||||
|
|
||||||
expectEmit(source, MyComponentDefinition, 'Incorrect ChildComponent.ɵcmp');
|
expectEmit(source, MyComponentDefinition, 'Incorrect ChildComponent.ɵcmp');
|
||||||
expectEmit(source, MyComponentFactory, 'Incorrect ChildComponent.ngFactoryDef');
|
expectEmit(source, MyComponentFactory, 'Incorrect ChildComponent.ɵfac');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not match directives on i18n-prefixed attributes', () => {
|
it('should not match directives on i18n-prefixed attributes', () => {
|
||||||
|
@ -103,14 +103,14 @@ describe('compiler compliance: directives', () => {
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const MyComponentFactory = `
|
const MyComponentFactory = `
|
||||||
MyComponent.ngFactoryDef = function MyComponent_Factory(t) { return new (t || MyComponent)(); };
|
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); };
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const result = compile(files, angularFiles);
|
const result = compile(files, angularFiles);
|
||||||
const source = result.source;
|
const source = result.source;
|
||||||
|
|
||||||
expectEmit(source, MyComponentDefinition, 'Incorrect ChildComponent.ɵcmp');
|
expectEmit(source, MyComponentDefinition, 'Incorrect ChildComponent.ɵcmp');
|
||||||
expectEmit(source, MyComponentFactory, 'Incorrect ChildComponent.ngFactoryDef');
|
expectEmit(source, MyComponentFactory, 'Incorrect ChildComponent.ɵfac');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should match directives on element bindings', () => {
|
it('should match directives on element bindings', () => {
|
||||||
|
|
|
@ -220,14 +220,14 @@ describe('compiler compliance: listen()', () => {
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const MyComponentFactory = `
|
const MyComponentFactory = `
|
||||||
MyComponent.ngFactoryDef = function MyComponent_Factory(t) { return new (t || MyComponent)(); };
|
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); };
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const result = compile(files, angularFiles);
|
const result = compile(files, angularFiles);
|
||||||
const source = result.source;
|
const source = result.source;
|
||||||
|
|
||||||
expectEmit(source, MyComponentDefinition, 'Incorrect MyComponent.ɵcmp');
|
expectEmit(source, MyComponentDefinition, 'Incorrect MyComponent.ɵcmp');
|
||||||
expectEmit(source, MyComponentFactory, 'Incorrect MyComponent.ngFactoryDef');
|
expectEmit(source, MyComponentFactory, 'Incorrect MyComponent.ɵfac');
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -144,7 +144,7 @@ describe('compiler compliance: providers', () => {
|
||||||
result.source, `
|
result.source, `
|
||||||
export class MyComponent {
|
export class MyComponent {
|
||||||
}
|
}
|
||||||
MyComponent.ngFactoryDef = function MyComponent_Factory(t) { return new (t || MyComponent)(); };
|
MyComponent.ɵfac = function MyComponent_Factory(t) { return new (t || MyComponent)(); };
|
||||||
MyComponent.ɵcmp = i0.ɵɵdefineComponent({
|
MyComponent.ɵcmp = i0.ɵɵdefineComponent({
|
||||||
type: MyComponent,
|
type: MyComponent,
|
||||||
selectors: [["my-component"]],
|
selectors: [["my-component"]],
|
||||||
|
|
|
@ -67,8 +67,8 @@ runInEachFileSystem(os => {
|
||||||
const dtsContents = env.getContents('test.d.ts');
|
const dtsContents = env.getContents('test.d.ts');
|
||||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵɵInjectableDef<Dep>;');
|
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵɵInjectableDef<Dep>;');
|
||||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵɵInjectableDef<Service>;');
|
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵɵInjectableDef<Service>;');
|
||||||
expect(dtsContents).toContain('static ngFactoryDef: i0.ɵɵFactoryDef<Dep>;');
|
expect(dtsContents).toContain('static ɵfac: i0.ɵɵFactoryDef<Dep>;');
|
||||||
expect(dtsContents).toContain('static ngFactoryDef: i0.ɵɵFactoryDef<Service>;');
|
expect(dtsContents).toContain('static ɵfac: i0.ɵɵFactoryDef<Service>;');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should compile Injectables with a generic service', () => {
|
it('should compile Injectables with a generic service', () => {
|
||||||
|
@ -85,7 +85,7 @@ runInEachFileSystem(os => {
|
||||||
const jsContents = env.getContents('test.js');
|
const jsContents = env.getContents('test.js');
|
||||||
expect(jsContents).toContain('Store.ngInjectableDef =');
|
expect(jsContents).toContain('Store.ngInjectableDef =');
|
||||||
const dtsContents = env.getContents('test.d.ts');
|
const dtsContents = env.getContents('test.d.ts');
|
||||||
expect(dtsContents).toContain('static ngFactoryDef: i0.ɵɵFactoryDef<Store<any>>;');
|
expect(dtsContents).toContain('static ɵfac: i0.ɵɵFactoryDef<Store<any>>;');
|
||||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵɵInjectableDef<Store<any>>;');
|
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵɵInjectableDef<Store<any>>;');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -110,14 +110,14 @@ runInEachFileSystem(os => {
|
||||||
expect(jsContents).toContain('Service.ngInjectableDef =');
|
expect(jsContents).toContain('Service.ngInjectableDef =');
|
||||||
expect(jsContents)
|
expect(jsContents)
|
||||||
.toContain(
|
.toContain(
|
||||||
'Service.ngFactoryDef = function Service_Factory(t) { return new (t || Service)(i0.ɵɵinject(Dep)); };');
|
'Service.ɵfac = function Service_Factory(t) { return new (t || Service)(i0.ɵɵinject(Dep)); };');
|
||||||
expect(jsContents).toContain('providedIn: \'root\' })');
|
expect(jsContents).toContain('providedIn: \'root\' })');
|
||||||
expect(jsContents).not.toContain('__decorate');
|
expect(jsContents).not.toContain('__decorate');
|
||||||
const dtsContents = env.getContents('test.d.ts');
|
const dtsContents = env.getContents('test.d.ts');
|
||||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵɵInjectableDef<Dep>;');
|
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵɵInjectableDef<Dep>;');
|
||||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵɵInjectableDef<Service>;');
|
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵɵInjectableDef<Service>;');
|
||||||
expect(dtsContents).toContain('static ngFactoryDef: i0.ɵɵFactoryDef<Dep>;');
|
expect(dtsContents).toContain('static ɵfac: i0.ɵɵFactoryDef<Dep>;');
|
||||||
expect(dtsContents).toContain('static ngFactoryDef: i0.ɵɵFactoryDef<Service>;');
|
expect(dtsContents).toContain('static ɵfac: i0.ɵɵFactoryDef<Service>;');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should compile Injectables with providedIn and factory without errors', () => {
|
it('should compile Injectables with providedIn and factory without errors', () => {
|
||||||
|
@ -142,7 +142,7 @@ runInEachFileSystem(os => {
|
||||||
expect(jsContents).not.toContain('__decorate');
|
expect(jsContents).not.toContain('__decorate');
|
||||||
const dtsContents = env.getContents('test.d.ts');
|
const dtsContents = env.getContents('test.d.ts');
|
||||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵɵInjectableDef<Service>;');
|
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵɵInjectableDef<Service>;');
|
||||||
expect(dtsContents).toContain('static ngFactoryDef: i0.ɵɵFactoryDef<Service>;');
|
expect(dtsContents).toContain('static ɵfac: i0.ɵɵFactoryDef<Service>;');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should compile Injectables with providedIn and factory with deps without errors', () => {
|
it('should compile Injectables with providedIn and factory with deps without errors', () => {
|
||||||
|
@ -171,7 +171,7 @@ runInEachFileSystem(os => {
|
||||||
expect(jsContents).not.toContain('__decorate');
|
expect(jsContents).not.toContain('__decorate');
|
||||||
const dtsContents = env.getContents('test.d.ts');
|
const dtsContents = env.getContents('test.d.ts');
|
||||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵɵInjectableDef<Service>;');
|
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵɵInjectableDef<Service>;');
|
||||||
expect(dtsContents).toContain('static ngFactoryDef: i0.ɵɵFactoryDef<Service>;');
|
expect(dtsContents).toContain('static ɵfac: i0.ɵɵFactoryDef<Service>;');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should compile @Injectable with an @Optional dependency', () => {
|
it('should compile @Injectable with an @Optional dependency', () => {
|
||||||
|
@ -206,14 +206,14 @@ runInEachFileSystem(os => {
|
||||||
|
|
||||||
const jsContents = env.getContents('test.js');
|
const jsContents = env.getContents('test.js');
|
||||||
expect(jsContents).toContain('TestCmp.ɵcmp = i0.ɵɵdefineComponent');
|
expect(jsContents).toContain('TestCmp.ɵcmp = i0.ɵɵdefineComponent');
|
||||||
expect(jsContents).toContain('TestCmp.ngFactoryDef = function');
|
expect(jsContents).toContain('TestCmp.ɵfac = function');
|
||||||
expect(jsContents).not.toContain('__decorate');
|
expect(jsContents).not.toContain('__decorate');
|
||||||
|
|
||||||
const dtsContents = env.getContents('test.d.ts');
|
const dtsContents = env.getContents('test.d.ts');
|
||||||
expect(dtsContents)
|
expect(dtsContents)
|
||||||
.toContain(
|
.toContain(
|
||||||
'static ɵcmp: i0.ɵɵComponentDefWithMeta<TestCmp, "test-cmp", never, {}, {}, never>');
|
'static ɵcmp: i0.ɵɵComponentDefWithMeta<TestCmp, "test-cmp", never, {}, {}, never>');
|
||||||
expect(dtsContents).toContain('static ngFactoryDef: i0.ɵɵFactoryDef<TestCmp>');
|
expect(dtsContents).toContain('static ɵfac: i0.ɵɵFactoryDef<TestCmp>');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should compile Components (dynamic inline template) without errors', () => {
|
it('should compile Components (dynamic inline template) without errors', () => {
|
||||||
|
@ -231,7 +231,7 @@ runInEachFileSystem(os => {
|
||||||
|
|
||||||
const jsContents = env.getContents('test.js');
|
const jsContents = env.getContents('test.js');
|
||||||
expect(jsContents).toContain('TestCmp.ɵcmp = i0.ɵɵdefineComponent');
|
expect(jsContents).toContain('TestCmp.ɵcmp = i0.ɵɵdefineComponent');
|
||||||
expect(jsContents).toContain('TestCmp.ngFactoryDef = function');
|
expect(jsContents).toContain('TestCmp.ɵfac = function');
|
||||||
expect(jsContents).not.toContain('__decorate');
|
expect(jsContents).not.toContain('__decorate');
|
||||||
|
|
||||||
const dtsContents = env.getContents('test.d.ts');
|
const dtsContents = env.getContents('test.d.ts');
|
||||||
|
@ -239,7 +239,7 @@ runInEachFileSystem(os => {
|
||||||
expect(dtsContents)
|
expect(dtsContents)
|
||||||
.toContain(
|
.toContain(
|
||||||
'static ɵcmp: i0.ɵɵComponentDefWithMeta<TestCmp, "test-cmp", never, {}, {}, never>');
|
'static ɵcmp: i0.ɵɵComponentDefWithMeta<TestCmp, "test-cmp", never, {}, {}, never>');
|
||||||
expect(dtsContents).toContain('static ngFactoryDef: i0.ɵɵFactoryDef<TestCmp>');
|
expect(dtsContents).toContain('static ɵfac: i0.ɵɵFactoryDef<TestCmp>');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should compile Components (function call inline template) without errors', () => {
|
it('should compile Components (function call inline template) without errors', () => {
|
||||||
|
@ -260,14 +260,14 @@ runInEachFileSystem(os => {
|
||||||
|
|
||||||
const jsContents = env.getContents('test.js');
|
const jsContents = env.getContents('test.js');
|
||||||
expect(jsContents).toContain('TestCmp.ɵcmp = i0.ɵɵdefineComponent');
|
expect(jsContents).toContain('TestCmp.ɵcmp = i0.ɵɵdefineComponent');
|
||||||
expect(jsContents).toContain('TestCmp.ngFactoryDef = function');
|
expect(jsContents).toContain('TestCmp.ɵfac = function');
|
||||||
expect(jsContents).not.toContain('__decorate');
|
expect(jsContents).not.toContain('__decorate');
|
||||||
|
|
||||||
const dtsContents = env.getContents('test.d.ts');
|
const dtsContents = env.getContents('test.d.ts');
|
||||||
expect(dtsContents)
|
expect(dtsContents)
|
||||||
.toContain(
|
.toContain(
|
||||||
'static ɵcmp: i0.ɵɵComponentDefWithMeta<TestCmp, "test-cmp", never, {}, {}, never>');
|
'static ɵcmp: i0.ɵɵComponentDefWithMeta<TestCmp, "test-cmp", never, {}, {}, never>');
|
||||||
expect(dtsContents).toContain('static ngFactoryDef: i0.ɵɵFactoryDef<TestCmp>');
|
expect(dtsContents).toContain('static ɵfac: i0.ɵɵFactoryDef<TestCmp>');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should compile Components (external template) without errors', () => {
|
it('should compile Components (external template) without errors', () => {
|
||||||
|
@ -899,10 +899,10 @@ runInEachFileSystem(os => {
|
||||||
'TestPipe.ngPipeDef = i0.ɵɵdefinePipe({ name: "test-pipe", type: TestPipe, pure: false })');
|
'TestPipe.ngPipeDef = i0.ɵɵdefinePipe({ name: "test-pipe", type: TestPipe, pure: false })');
|
||||||
expect(jsContents)
|
expect(jsContents)
|
||||||
.toContain(
|
.toContain(
|
||||||
'TestPipe.ngFactoryDef = function TestPipe_Factory(t) { return new (t || TestPipe)(); }');
|
'TestPipe.ɵfac = function TestPipe_Factory(t) { return new (t || TestPipe)(); }');
|
||||||
expect(dtsContents)
|
expect(dtsContents)
|
||||||
.toContain('static ngPipeDef: i0.ɵɵPipeDefWithMeta<TestPipe, "test-pipe">;');
|
.toContain('static ngPipeDef: i0.ɵɵPipeDefWithMeta<TestPipe, "test-pipe">;');
|
||||||
expect(dtsContents).toContain('static ngFactoryDef: i0.ɵɵFactoryDef<TestPipe>;');
|
expect(dtsContents).toContain('static ɵfac: i0.ɵɵFactoryDef<TestPipe>;');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should compile pure Pipes without errors', () => {
|
it('should compile pure Pipes without errors', () => {
|
||||||
|
@ -925,10 +925,10 @@ runInEachFileSystem(os => {
|
||||||
'TestPipe.ngPipeDef = i0.ɵɵdefinePipe({ name: "test-pipe", type: TestPipe, pure: true })');
|
'TestPipe.ngPipeDef = i0.ɵɵdefinePipe({ name: "test-pipe", type: TestPipe, pure: true })');
|
||||||
expect(jsContents)
|
expect(jsContents)
|
||||||
.toContain(
|
.toContain(
|
||||||
'TestPipe.ngFactoryDef = function TestPipe_Factory(t) { return new (t || TestPipe)(); }');
|
'TestPipe.ɵfac = function TestPipe_Factory(t) { return new (t || TestPipe)(); }');
|
||||||
expect(dtsContents)
|
expect(dtsContents)
|
||||||
.toContain('static ngPipeDef: i0.ɵɵPipeDefWithMeta<TestPipe, "test-pipe">;');
|
.toContain('static ngPipeDef: i0.ɵɵPipeDefWithMeta<TestPipe, "test-pipe">;');
|
||||||
expect(dtsContents).toContain('static ngFactoryDef: i0.ɵɵFactoryDef<TestPipe>;');
|
expect(dtsContents).toContain('static ɵfac: i0.ɵɵFactoryDef<TestPipe>;');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should compile Pipes with dependencies', () => {
|
it('should compile Pipes with dependencies', () => {
|
||||||
|
@ -969,7 +969,7 @@ runInEachFileSystem(os => {
|
||||||
const dtsContents = env.getContents('test.d.ts');
|
const dtsContents = env.getContents('test.d.ts');
|
||||||
expect(dtsContents)
|
expect(dtsContents)
|
||||||
.toContain('static ngPipeDef: i0.ɵɵPipeDefWithMeta<TestPipe<any>, "test-pipe">;');
|
.toContain('static ngPipeDef: i0.ɵɵPipeDefWithMeta<TestPipe<any>, "test-pipe">;');
|
||||||
expect(dtsContents).toContain('static ngFactoryDef: i0.ɵɵFactoryDef<TestPipe<any>>;');
|
expect(dtsContents).toContain('static ɵfac: i0.ɵɵFactoryDef<TestPipe<any>>;');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should include @Pipes in @NgModule scopes', () => {
|
it('should include @Pipes in @NgModule scopes', () => {
|
||||||
|
@ -1309,8 +1309,7 @@ runInEachFileSystem(os => {
|
||||||
|
|
||||||
env.driveMain();
|
env.driveMain();
|
||||||
const jsContents = env.getContents('test.js');
|
const jsContents = env.getContents('test.js');
|
||||||
expect(jsContents)
|
expect(jsContents).toContain('Test.ɵfac = function Test_Factory(t) { throw new Error(');
|
||||||
.toContain('Test.ngFactoryDef = function Test_Factory(t) { throw new Error(');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should compile an @Injectable provided in the root on a class with a non-injectable constructor',
|
it('should compile an @Injectable provided in the root on a class with a non-injectable constructor',
|
||||||
|
@ -1327,7 +1326,7 @@ runInEachFileSystem(os => {
|
||||||
env.driveMain();
|
env.driveMain();
|
||||||
const jsContents = env.getContents('test.js');
|
const jsContents = env.getContents('test.js');
|
||||||
expect(jsContents)
|
expect(jsContents)
|
||||||
.toContain('Test.ngFactoryDef = function Test_Factory(t) { throw new Error(');
|
.toContain('Test.ɵfac = function Test_Factory(t) { throw new Error(');
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -1640,7 +1639,7 @@ runInEachFileSystem(os => {
|
||||||
const jsContents = env.getContents('test.js');
|
const jsContents = env.getContents('test.js');
|
||||||
expect(jsContents)
|
expect(jsContents)
|
||||||
.toContain(
|
.toContain(
|
||||||
`FooCmp.ngFactoryDef = function FooCmp_Factory(t) { return new (t || FooCmp)(i0.ɵɵinjectAttribute("test"), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.TemplateRef), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); }`);
|
`FooCmp.ɵfac = function FooCmp_Factory(t) { return new (t || FooCmp)(i0.ɵɵinjectAttribute("test"), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.TemplateRef), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); }`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should generate queries for components', () => {
|
it('should generate queries for components', () => {
|
||||||
|
|
|
@ -117,8 +117,8 @@ export function compileInjectable(meta: R3InjectableMetadata): InjectableDef {
|
||||||
function delegateToFactory(type: o.Expression) {
|
function delegateToFactory(type: o.Expression) {
|
||||||
return {
|
return {
|
||||||
statements: [],
|
statements: [],
|
||||||
// () => meta.type.ngFactoryDef(t)
|
// () => meta.type.ɵfac(t)
|
||||||
factory: o.fn([new o.FnParam('t', o.DYNAMIC_TYPE)], [new o.ReturnStatement(type.callMethod(
|
factory: o.fn([new o.FnParam('t', o.DYNAMIC_TYPE)], [new o.ReturnStatement(type.callMethod(
|
||||||
'ngFactoryDef', [o.variable('t')]))])
|
'ɵfac', [o.variable('t')]))])
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,7 +259,7 @@ export function compileFactoryFunction(meta: R3FactoryMetadata, isPipe = false):
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs the `ngFactoryDef` from directive/component/pipe metadata.
|
* Constructs the factory def (`ɵfac`) from directive/component/pipe metadata.
|
||||||
*/
|
*/
|
||||||
export function compileFactoryFromMetadata(meta: R3FactoryDefMetadata): R3FactoryFn {
|
export function compileFactoryFromMetadata(meta: R3FactoryDefMetadata): R3FactoryFn {
|
||||||
return compileFactoryFunction(
|
return compileFactoryFunction(
|
||||||
|
|
|
@ -97,7 +97,7 @@ export function compilePipeFromRender2(
|
||||||
/* parent */ null,
|
/* parent */ null,
|
||||||
/* fields */
|
/* fields */
|
||||||
[new o.ClassField(
|
[new o.ClassField(
|
||||||
/* name */ 'ngFactoryDef',
|
/* name */ 'ɵfac',
|
||||||
/* type */ o.INFERRED_TYPE,
|
/* type */ o.INFERRED_TYPE,
|
||||||
/* modifiers */[o.StmtModifier.Static],
|
/* modifiers */[o.StmtModifier.Static],
|
||||||
/* initializer */ factoryRes.factory)],
|
/* initializer */ factoryRes.factory)],
|
||||||
|
|
|
@ -334,9 +334,8 @@ export function compileDirectiveFromRender2(
|
||||||
const factoryRes = compileFactoryFromMetadata({...meta, injectFn: R3.directiveInject});
|
const factoryRes = compileFactoryFromMetadata({...meta, injectFn: R3.directiveInject});
|
||||||
const ngFactoryDefStatement = new o.ClassStmt(
|
const ngFactoryDefStatement = new o.ClassStmt(
|
||||||
name, null,
|
name, null,
|
||||||
[new o.ClassField(
|
[new o.ClassField('ɵfac', o.INFERRED_TYPE, [o.StmtModifier.Static], factoryRes.factory)], [],
|
||||||
'ngFactoryDef', o.INFERRED_TYPE, [o.StmtModifier.Static], factoryRes.factory)],
|
new o.ClassMethod(null, [], []), []);
|
||||||
[], new o.ClassMethod(null, [], []), []);
|
|
||||||
const directiveDefStatement = new o.ClassStmt(
|
const directiveDefStatement = new o.ClassStmt(
|
||||||
name, null,
|
name, null,
|
||||||
[new o.ClassField(definitionField, o.INFERRED_TYPE, [o.StmtModifier.Static], res.expression)],
|
[new o.ClassField(definitionField, o.INFERRED_TYPE, [o.StmtModifier.Static], res.expression)],
|
||||||
|
@ -387,9 +386,8 @@ export function compileComponentFromRender2(
|
||||||
const factoryRes = compileFactoryFromMetadata({...meta, injectFn: R3.directiveInject});
|
const factoryRes = compileFactoryFromMetadata({...meta, injectFn: R3.directiveInject});
|
||||||
const ngFactoryDefStatement = new o.ClassStmt(
|
const ngFactoryDefStatement = new o.ClassStmt(
|
||||||
name, null,
|
name, null,
|
||||||
[new o.ClassField(
|
[new o.ClassField('ɵfac', o.INFERRED_TYPE, [o.StmtModifier.Static], factoryRes.factory)], [],
|
||||||
'ngFactoryDef', o.INFERRED_TYPE, [o.StmtModifier.Static], factoryRes.factory)],
|
new o.ClassMethod(null, [], []), []);
|
||||||
[], new o.ClassMethod(null, [], []), []);
|
|
||||||
const componentDefStatement = new o.ClassStmt(
|
const componentDefStatement = new o.ClassStmt(
|
||||||
name, null,
|
name, null,
|
||||||
[new o.ClassField(definitionField, o.INFERRED_TYPE, [o.StmtModifier.Static], res.expression)],
|
[new o.ClassField(definitionField, o.INFERRED_TYPE, [o.StmtModifier.Static], res.expression)],
|
||||||
|
|
|
@ -48,8 +48,8 @@ export function compileInjectable(type: Type<any>, srcMeta?: Injectable): void {
|
||||||
get: () => {
|
get: () => {
|
||||||
if (ngFactoryDef === null) {
|
if (ngFactoryDef === null) {
|
||||||
const metadata = getInjectableMetadata(type, srcMeta);
|
const metadata = getInjectableMetadata(type, srcMeta);
|
||||||
ngFactoryDef = getCompilerFacade().compileFactory(
|
ngFactoryDef =
|
||||||
angularCoreDiEnv, `ng:///${type.name}/ngFactoryDef.js`, {
|
getCompilerFacade().compileFactory(angularCoreDiEnv, `ng:///${type.name}/ɵfac.js`, {
|
||||||
name: metadata.name,
|
name: metadata.name,
|
||||||
type: metadata.type,
|
type: metadata.type,
|
||||||
typeArgumentCount: metadata.typeArgumentCount,
|
typeArgumentCount: metadata.typeArgumentCount,
|
||||||
|
|
|
@ -760,7 +760,7 @@ export function getFactoryDef<T>(type: any): FactoryFn<T>|null;
|
||||||
export function getFactoryDef<T>(type: any, throwNotFound?: boolean): FactoryFn<T>|null {
|
export function getFactoryDef<T>(type: any, throwNotFound?: boolean): FactoryFn<T>|null {
|
||||||
const hasFactoryDef = type.hasOwnProperty(NG_FACTORY_DEF);
|
const hasFactoryDef = type.hasOwnProperty(NG_FACTORY_DEF);
|
||||||
if (!hasFactoryDef && throwNotFound === true && ngDevMode) {
|
if (!hasFactoryDef && throwNotFound === true && ngDevMode) {
|
||||||
throw new Error(`Type ${stringify(type)} does not have 'ngFactoryDef' property.`);
|
throw new Error(`Type ${stringify(type)} does not have 'ɵfac' property.`);
|
||||||
}
|
}
|
||||||
return hasFactoryDef ? type[NG_FACTORY_DEF] : null;
|
return hasFactoryDef ? type[NG_FACTORY_DEF] : null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ export const NG_PIPE_DEF = getClosureSafeProperty({ngPipeDef: getClosureSafeProp
|
||||||
export const NG_MODULE_DEF = getClosureSafeProperty({ngModuleDef: getClosureSafeProperty});
|
export const NG_MODULE_DEF = getClosureSafeProperty({ngModuleDef: getClosureSafeProperty});
|
||||||
export const NG_LOCALE_ID_DEF = getClosureSafeProperty({ngLocaleIdDef: getClosureSafeProperty});
|
export const NG_LOCALE_ID_DEF = getClosureSafeProperty({ngLocaleIdDef: getClosureSafeProperty});
|
||||||
export const NG_BASE_DEF = getClosureSafeProperty({ngBaseDef: getClosureSafeProperty});
|
export const NG_BASE_DEF = getClosureSafeProperty({ngBaseDef: getClosureSafeProperty});
|
||||||
export const NG_FACTORY_DEF = getClosureSafeProperty({ngFactoryDef: getClosureSafeProperty});
|
export const NG_FACTORY_DEF = getClosureSafeProperty({ɵfac: getClosureSafeProperty});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If a directive is diPublic, bloomAdd sets a property on the type with this constant as
|
* If a directive is diPublic, bloomAdd sets a property on the type with this constant as
|
||||||
|
|
|
@ -80,7 +80,7 @@ export interface ComponentType<T> extends Type<T> { ɵcmp: never; }
|
||||||
*/
|
*/
|
||||||
export interface DirectiveType<T> extends Type<T> {
|
export interface DirectiveType<T> extends Type<T> {
|
||||||
ɵdir: never;
|
ɵdir: never;
|
||||||
ngFactoryDef: () => T;
|
ɵfac: () => T;
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum DirectiveDefFlags {
|
export enum DirectiveDefFlags {
|
||||||
|
|
|
@ -166,7 +166,7 @@ function addDirectiveFactoryDef(type: Type<any>, metadata: Directive | Component
|
||||||
if (ngFactoryDef === null) {
|
if (ngFactoryDef === null) {
|
||||||
const meta = getDirectiveMetadata(type, metadata);
|
const meta = getDirectiveMetadata(type, metadata);
|
||||||
ngFactoryDef = getCompilerFacade().compileFactory(
|
ngFactoryDef = getCompilerFacade().compileFactory(
|
||||||
angularCoreEnv, `ng:///${type.name}/ngFactoryDef.js`,
|
angularCoreEnv, `ng:///${type.name}/ɵfac.js`,
|
||||||
{...meta.metadata, injectFn: 'directiveInject', isPipe: false});
|
{...meta.metadata, injectFn: 'directiveInject', isPipe: false});
|
||||||
}
|
}
|
||||||
return ngFactoryDef;
|
return ngFactoryDef;
|
||||||
|
|
|
@ -23,7 +23,7 @@ export function compilePipe(type: Type<any>, meta: Pipe): void {
|
||||||
if (ngFactoryDef === null) {
|
if (ngFactoryDef === null) {
|
||||||
const metadata = getPipeMetadata(type, meta);
|
const metadata = getPipeMetadata(type, meta);
|
||||||
ngFactoryDef = getCompilerFacade().compileFactory(
|
ngFactoryDef = getCompilerFacade().compileFactory(
|
||||||
angularCoreEnv, `ng:///${metadata.name}/ngFactoryDef.js`,
|
angularCoreEnv, `ng:///${metadata.name}/ɵfac.js`,
|
||||||
{...metadata, injectFn: 'directiveInject', isPipe: true});
|
{...metadata, injectFn: 'directiveInject', isPipe: true});
|
||||||
}
|
}
|
||||||
return ngFactoryDef;
|
return ngFactoryDef;
|
||||||
|
|
|
@ -33,7 +33,7 @@ describe('iv perf test', () => {
|
||||||
|
|
||||||
it(`${iteration}. create ${count} divs in Render3`, () => {
|
it(`${iteration}. create ${count} divs in Render3`, () => {
|
||||||
class Component {
|
class Component {
|
||||||
static ngFactoryDef = () => new Component;
|
static ɵfac = () => new Component;
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: Component,
|
type: Component,
|
||||||
selectors: [['div']],
|
selectors: [['div']],
|
||||||
|
|
|
@ -25,7 +25,7 @@ describe('change detection', () => {
|
||||||
doCheckCount = 0;
|
doCheckCount = 0;
|
||||||
ngDoCheck(): void { this.doCheckCount++; }
|
ngDoCheck(): void { this.doCheckCount++; }
|
||||||
|
|
||||||
static ngFactoryDef = () => new MyComponent();
|
static ɵfac = () => new MyComponent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: MyComponent,
|
type: MyComponent,
|
||||||
selectors: [['my-comp']],
|
selectors: [['my-comp']],
|
||||||
|
@ -101,7 +101,7 @@ describe('change detection', () => {
|
||||||
|
|
||||||
onClick() {}
|
onClick() {}
|
||||||
|
|
||||||
static ngFactoryDef = () => comp = new MyComponent();
|
static ɵfac = () => comp = new MyComponent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: MyComponent,
|
type: MyComponent,
|
||||||
selectors: [['my-comp']],
|
selectors: [['my-comp']],
|
||||||
|
@ -139,7 +139,7 @@ describe('change detection', () => {
|
||||||
|
|
||||||
onClick() {}
|
onClick() {}
|
||||||
|
|
||||||
static ngFactoryDef = () => comp = new ManualComponent();
|
static ɵfac = () => comp = new ManualComponent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ManualComponent,
|
type: ManualComponent,
|
||||||
selectors: [['manual-comp']],
|
selectors: [['manual-comp']],
|
||||||
|
@ -175,7 +175,7 @@ describe('change detection', () => {
|
||||||
class ManualApp {
|
class ManualApp {
|
||||||
name: string = 'Nancy';
|
name: string = 'Nancy';
|
||||||
|
|
||||||
static ngFactoryDef = () => new ManualApp();
|
static ɵfac = () => new ManualApp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ManualApp,
|
type: ManualApp,
|
||||||
selectors: [['manual-app']],
|
selectors: [['manual-app']],
|
||||||
|
@ -230,7 +230,7 @@ describe('change detection', () => {
|
||||||
doCheckCount = 0;
|
doCheckCount = 0;
|
||||||
ngDoCheck(): void { this.doCheckCount++; }
|
ngDoCheck(): void { this.doCheckCount++; }
|
||||||
|
|
||||||
static ngFactoryDef = () => parent = new ButtonParent();
|
static ɵfac = () => parent = new ButtonParent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ButtonParent,
|
type: ButtonParent,
|
||||||
selectors: [['button-parent']],
|
selectors: [['button-parent']],
|
||||||
|
@ -307,7 +307,7 @@ describe('change detection', () => {
|
||||||
return 'works';
|
return 'works';
|
||||||
}
|
}
|
||||||
|
|
||||||
static ngFactoryDef = () => new MyComponent();
|
static ɵfac = () => new MyComponent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: MyComponent,
|
type: MyComponent,
|
||||||
selectors: [['my-comp']],
|
selectors: [['my-comp']],
|
||||||
|
|
|
@ -25,7 +25,7 @@ NgForOf.ɵdir = ɵɵdefineDirective({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
NgForOf.ngFactoryDef = () => new NgForOfDef(
|
NgForOf.ɵfac = () => new NgForOfDef(
|
||||||
ɵɵdirectiveInject(ViewContainerRef as any), ɵɵdirectiveInject(TemplateRef as any),
|
ɵɵdirectiveInject(ViewContainerRef as any), ɵɵdirectiveInject(TemplateRef as any),
|
||||||
ɵɵdirectiveInject(IterableDiffers));
|
ɵɵdirectiveInject(IterableDiffers));
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ NgIf.ɵdir = ɵɵdefineDirective({
|
||||||
inputs: {ngIf: 'ngIf', ngIfThen: 'ngIfThen', ngIfElse: 'ngIfElse'}
|
inputs: {ngIf: 'ngIf', ngIfThen: 'ngIfThen', ngIfElse: 'ngIfElse'}
|
||||||
});
|
});
|
||||||
|
|
||||||
NgIf.ngFactoryDef = () =>
|
NgIf.ɵfac = () =>
|
||||||
new NgIfDef(ɵɵdirectiveInject(ViewContainerRef as any), ɵɵdirectiveInject(TemplateRef as any));
|
new NgIfDef(ɵɵdirectiveInject(ViewContainerRef as any), ɵɵdirectiveInject(TemplateRef as any));
|
||||||
|
|
||||||
NgTemplateOutlet.ɵdir = ɵɵdefineDirective({
|
NgTemplateOutlet.ɵdir = ɵɵdefineDirective({
|
||||||
|
@ -46,5 +46,4 @@ NgTemplateOutlet.ɵdir = ɵɵdefineDirective({
|
||||||
{ngTemplateOutlet: 'ngTemplateOutlet', ngTemplateOutletContext: 'ngTemplateOutletContext'}
|
{ngTemplateOutlet: 'ngTemplateOutlet', ngTemplateOutletContext: 'ngTemplateOutletContext'}
|
||||||
});
|
});
|
||||||
|
|
||||||
NgTemplateOutlet.ngFactoryDef = () =>
|
NgTemplateOutlet.ɵfac = () => new NgTemplateOutletDef(ɵɵdirectiveInject(ViewContainerRef as any));
|
||||||
new NgTemplateOutletDef(ɵɵdirectiveInject(ViewContainerRef as any));
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ describe('ComponentFactory', () => {
|
||||||
describe('constructor()', () => {
|
describe('constructor()', () => {
|
||||||
it('should correctly populate default properties', () => {
|
it('should correctly populate default properties', () => {
|
||||||
class TestComponent {
|
class TestComponent {
|
||||||
static ngFactoryDef = () => new TestComponent();
|
static ɵfac = () => new TestComponent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: TestComponent,
|
type: TestComponent,
|
||||||
selectors: [['test', 'foo'], ['bar']],
|
selectors: [['test', 'foo'], ['bar']],
|
||||||
|
@ -41,7 +41,7 @@ describe('ComponentFactory', () => {
|
||||||
|
|
||||||
it('should correctly populate defined properties', () => {
|
it('should correctly populate defined properties', () => {
|
||||||
class TestComponent {
|
class TestComponent {
|
||||||
static ngFactoryDef = () => new TestComponent();
|
static ɵfac = () => new TestComponent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: TestComponent,
|
type: TestComponent,
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
@ -89,7 +89,7 @@ describe('ComponentFactory', () => {
|
||||||
createRenderer3Spy = spyOn(domRendererFactory3, 'createRenderer').and.callThrough();
|
createRenderer3Spy = spyOn(domRendererFactory3, 'createRenderer').and.callThrough();
|
||||||
|
|
||||||
class TestComponent {
|
class TestComponent {
|
||||||
static ngFactoryDef = () => new TestComponent();
|
static ɵfac = () => new TestComponent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: TestComponent,
|
type: TestComponent,
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
|
|
@ -21,7 +21,7 @@ describe('component', () => {
|
||||||
|
|
||||||
increment() { this.count++; }
|
increment() { this.count++; }
|
||||||
|
|
||||||
static ngFactoryDef = () => new CounterComponent;
|
static ɵfac = () => new CounterComponent;
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: CounterComponent,
|
type: CounterComponent,
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
@ -71,7 +71,7 @@ describe('component', () => {
|
||||||
}
|
}
|
||||||
class MyComponent {
|
class MyComponent {
|
||||||
constructor(public myService: MyService) {}
|
constructor(public myService: MyService) {}
|
||||||
static ngFactoryDef = () => new MyComponent(ɵɵdirectiveInject(MyService));
|
static ɵfac = () => new MyComponent(ɵɵdirectiveInject(MyService));
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: MyComponent,
|
type: MyComponent,
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
@ -115,7 +115,7 @@ describe('component', () => {
|
||||||
// @Input
|
// @Input
|
||||||
name = '';
|
name = '';
|
||||||
|
|
||||||
static ngFactoryDef = () => new Comp();
|
static ɵfac = () => new Comp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: Comp,
|
type: Comp,
|
||||||
selectors: [['comp']],
|
selectors: [['comp']],
|
||||||
|
@ -169,7 +169,7 @@ it('should not invoke renderer destroy method for embedded views', () => {
|
||||||
class Comp {
|
class Comp {
|
||||||
visible = true;
|
visible = true;
|
||||||
|
|
||||||
static ngFactoryDef =
|
static ɵfac =
|
||||||
() => {
|
() => {
|
||||||
comp = new Comp();
|
comp = new Comp();
|
||||||
return comp;
|
return comp;
|
||||||
|
@ -247,7 +247,7 @@ describe('component with a container', () => {
|
||||||
class WrapperComponent {
|
class WrapperComponent {
|
||||||
// TODO(issue/24571): remove '!'.
|
// TODO(issue/24571): remove '!'.
|
||||||
items !: string[];
|
items !: string[];
|
||||||
static ngFactoryDef = () => new WrapperComponent;
|
static ɵfac = () => new WrapperComponent;
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: WrapperComponent,
|
type: WrapperComponent,
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
@ -324,7 +324,7 @@ describe('recursive components', () => {
|
||||||
|
|
||||||
ngOnDestroy() { events.push('destroy' + this.data.value); }
|
ngOnDestroy() { events.push('destroy' + this.data.value); }
|
||||||
|
|
||||||
static ngFactoryDef = () => new TreeComponent();
|
static ɵfac = () => new TreeComponent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: TreeComponent,
|
type: TreeComponent,
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
@ -389,7 +389,7 @@ describe('recursive components', () => {
|
||||||
|
|
||||||
ngOnDestroy() { events.push('destroy' + this.data.value); }
|
ngOnDestroy() { events.push('destroy' + this.data.value); }
|
||||||
|
|
||||||
static ngFactoryDef = () => new NgIfTree();
|
static ɵfac = () => new NgIfTree();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: NgIfTree,
|
type: NgIfTree,
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
@ -530,7 +530,7 @@ describe('recursive components', () => {
|
||||||
class TestInputsComponent {
|
class TestInputsComponent {
|
||||||
// TODO(issue/24571): remove '!'.
|
// TODO(issue/24571): remove '!'.
|
||||||
minifiedName !: string;
|
minifiedName !: string;
|
||||||
static ngFactoryDef = () => new TestInputsComponent();
|
static ɵfac = () => new TestInputsComponent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: TestInputsComponent,
|
type: TestInputsComponent,
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
|
|
@ -693,7 +693,7 @@ describe('JS control flow', () => {
|
||||||
// Intentionally duplicating the templates in test below so we are
|
// Intentionally duplicating the templates in test below so we are
|
||||||
// testing the behavior on firstTemplatePass for each of these tests
|
// testing the behavior on firstTemplatePass for each of these tests
|
||||||
class Comp {
|
class Comp {
|
||||||
static ngFactoryDef =
|
static ɵfac =
|
||||||
() => {
|
() => {
|
||||||
log.push('comp!');
|
log.push('comp!');
|
||||||
return new Comp();
|
return new Comp();
|
||||||
|
@ -712,7 +712,7 @@ describe('JS control flow', () => {
|
||||||
condition = true;
|
condition = true;
|
||||||
condition2 = true;
|
condition2 = true;
|
||||||
|
|
||||||
static ngFactoryDef = () => new App();
|
static ɵfac = () => new App();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: App,
|
type: App,
|
||||||
selectors: [['app']],
|
selectors: [['app']],
|
||||||
|
@ -763,7 +763,7 @@ describe('JS control flow', () => {
|
||||||
// Intentionally duplicating the templates from above so we are
|
// Intentionally duplicating the templates from above so we are
|
||||||
// testing the behavior on firstTemplatePass for each of these tests
|
// testing the behavior on firstTemplatePass for each of these tests
|
||||||
class Comp {
|
class Comp {
|
||||||
static ngFactoryDef =
|
static ɵfac =
|
||||||
() => {
|
() => {
|
||||||
log.push('comp!');
|
log.push('comp!');
|
||||||
return new Comp();
|
return new Comp();
|
||||||
|
@ -782,7 +782,7 @@ describe('JS control flow', () => {
|
||||||
condition = false;
|
condition = false;
|
||||||
condition2 = true;
|
condition2 = true;
|
||||||
|
|
||||||
static ngFactoryDef = () => new App();
|
static ɵfac = () => new App();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: App,
|
type: App,
|
||||||
selectors: [['app']],
|
selectors: [['app']],
|
||||||
|
|
|
@ -28,7 +28,7 @@ describe('di', () => {
|
||||||
class DirB {
|
class DirB {
|
||||||
value = 'DirB';
|
value = 'DirB';
|
||||||
|
|
||||||
static ngFactoryDef = () => new DirB();
|
static ɵfac = () => new DirB();
|
||||||
static ɵdir =
|
static ɵdir =
|
||||||
ɵɵdefineDirective({selectors: [['', 'dirB', '']], type: DirB, inputs: {value: 'value'}});
|
ɵɵdefineDirective({selectors: [['', 'dirB', '']], type: DirB, inputs: {value: 'value'}});
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ describe('di', () => {
|
||||||
// TODO(issue/24571): remove '!'.
|
// TODO(issue/24571): remove '!'.
|
||||||
value !: string;
|
value !: string;
|
||||||
|
|
||||||
static ngFactoryDef = () => new DirB();
|
static ɵfac = () => new DirB();
|
||||||
static ɵdir =
|
static ɵdir =
|
||||||
ɵɵdefineDirective({type: DirB, selectors: [['', 'dirB', '']], inputs: {value: 'dirB'}});
|
ɵɵdefineDirective({type: DirB, selectors: [['', 'dirB', '']], inputs: {value: 'dirB'}});
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ describe('di', () => {
|
||||||
class DirA {
|
class DirA {
|
||||||
constructor(@Optional() public dirB: DirB|null) {}
|
constructor(@Optional() public dirB: DirB|null) {}
|
||||||
|
|
||||||
static ngFactoryDef =
|
static ɵfac =
|
||||||
() => {
|
() => {
|
||||||
dirA = new DirA(ɵɵdirectiveInject(DirB, InjectFlags.Optional));
|
dirA = new DirA(ɵɵdirectiveInject(DirB, InjectFlags.Optional));
|
||||||
return dirA;
|
return dirA;
|
||||||
|
@ -81,7 +81,7 @@ describe('di', () => {
|
||||||
class DirA {
|
class DirA {
|
||||||
constructor(@Self() public dirB: DirB) {}
|
constructor(@Self() public dirB: DirB) {}
|
||||||
|
|
||||||
static ngFactoryDef = () => dirA = new DirA(ɵɵdirectiveInject(DirB, InjectFlags.Self));
|
static ɵfac = () => dirA = new DirA(ɵɵdirectiveInject(DirB, InjectFlags.Self));
|
||||||
static ɵdir = ɵɵdefineDirective({type: DirA, selectors: [['', 'dirA', '']]});
|
static ɵdir = ɵɵdefineDirective({type: DirA, selectors: [['', 'dirA', '']]});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ describe('di', () => {
|
||||||
class MyComp {
|
class MyComp {
|
||||||
constructor(public renderer: Renderer2) {}
|
constructor(public renderer: Renderer2) {}
|
||||||
|
|
||||||
static ngFactoryDef = () => new MyComp(ɵɵdirectiveInject(Renderer2 as any));
|
static ɵfac = () => new MyComp(ɵɵdirectiveInject(Renderer2 as any));
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: MyComp,
|
type: MyComp,
|
||||||
selectors: [['my-comp']],
|
selectors: [['my-comp']],
|
||||||
|
|
|
@ -240,7 +240,7 @@ describe('instructions', () => {
|
||||||
class NestedLoops {
|
class NestedLoops {
|
||||||
rows = [['a', 'b'], ['A', 'B'], ['a', 'b'], ['A', 'B']];
|
rows = [['a', 'b'], ['A', 'B'], ['a', 'b'], ['A', 'B']];
|
||||||
|
|
||||||
static ngFactoryDef = function ToDoAppComponent_Factory() { return new NestedLoops(); };
|
static ɵfac = function ToDoAppComponent_Factory() { return new NestedLoops(); };
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: NestedLoops,
|
type: NestedLoops,
|
||||||
selectors: [['nested-loops']],
|
selectors: [['nested-loops']],
|
||||||
|
|
|
@ -117,7 +117,7 @@ describe('render3 integration test', () => {
|
||||||
// TODO(issue/24571): remove '!'.
|
// TODO(issue/24571): remove '!'.
|
||||||
afterTree !: Tree;
|
afterTree !: Tree;
|
||||||
|
|
||||||
static ngFactoryDef = () => new ChildComponent;
|
static ɵfac = () => new ChildComponent;
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
selectors: [['child']],
|
selectors: [['child']],
|
||||||
type: ChildComponent,
|
type: ChildComponent,
|
||||||
|
@ -199,7 +199,7 @@ describe('render3 integration test', () => {
|
||||||
describe('component styles', () => {
|
describe('component styles', () => {
|
||||||
it('should pass in the component styles directly into the underlying renderer', () => {
|
it('should pass in the component styles directly into the underlying renderer', () => {
|
||||||
class StyledComp {
|
class StyledComp {
|
||||||
static ngFactoryDef = () => new StyledComp();
|
static ɵfac = () => new StyledComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: StyledComp,
|
type: StyledComp,
|
||||||
styles: ['div { color: red; }'],
|
styles: ['div { color: red; }'],
|
||||||
|
@ -227,7 +227,7 @@ describe('component animations', () => {
|
||||||
const animB = {name: 'b'};
|
const animB = {name: 'b'};
|
||||||
|
|
||||||
class AnimComp {
|
class AnimComp {
|
||||||
static ngFactoryDef = () => new AnimComp();
|
static ɵfac = () => new AnimComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: AnimComp,
|
type: AnimComp,
|
||||||
decls: 0,
|
decls: 0,
|
||||||
|
@ -254,7 +254,7 @@ describe('component animations', () => {
|
||||||
|
|
||||||
it('should include animations in the renderType data array even if the array is empty', () => {
|
it('should include animations in the renderType data array even if the array is empty', () => {
|
||||||
class AnimComp {
|
class AnimComp {
|
||||||
static ngFactoryDef = () => new AnimComp();
|
static ɵfac = () => new AnimComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: AnimComp,
|
type: AnimComp,
|
||||||
decls: 0,
|
decls: 0,
|
||||||
|
@ -274,7 +274,7 @@ describe('component animations', () => {
|
||||||
|
|
||||||
it('should allow [@trigger] bindings to be picked up by the underlying renderer', () => {
|
it('should allow [@trigger] bindings to be picked up by the underlying renderer', () => {
|
||||||
class AnimComp {
|
class AnimComp {
|
||||||
static ngFactoryDef = () => new AnimComp();
|
static ɵfac = () => new AnimComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: AnimComp,
|
type: AnimComp,
|
||||||
decls: 1,
|
decls: 1,
|
||||||
|
@ -311,7 +311,7 @@ describe('component animations', () => {
|
||||||
it('should allow creation-level [@trigger] properties to be picked up by the underlying renderer',
|
it('should allow creation-level [@trigger] properties to be picked up by the underlying renderer',
|
||||||
() => {
|
() => {
|
||||||
class AnimComp {
|
class AnimComp {
|
||||||
static ngFactoryDef = () => new AnimComp();
|
static ɵfac = () => new AnimComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: AnimComp,
|
type: AnimComp,
|
||||||
decls: 1,
|
decls: 1,
|
||||||
|
@ -345,7 +345,7 @@ describe('component animations', () => {
|
||||||
|
|
||||||
// it('should allow host binding animations to be picked up and rendered', () => {
|
// it('should allow host binding animations to be picked up and rendered', () => {
|
||||||
// class ChildCompWithAnim {
|
// class ChildCompWithAnim {
|
||||||
// static ngFactoryDef = () => new ChildCompWithAnim();
|
// static ɵfac = () => new ChildCompWithAnim();
|
||||||
// static ɵdir = ɵɵdefineDirective({
|
// static ɵdir = ɵɵdefineDirective({
|
||||||
// type: ChildCompWithAnim,
|
// type: ChildCompWithAnim,
|
||||||
// selectors: [['child-comp-with-anim']],
|
// selectors: [['child-comp-with-anim']],
|
||||||
|
@ -360,7 +360,7 @@ describe('component animations', () => {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// class ParentComp {
|
// class ParentComp {
|
||||||
// static ngFactoryDef = () => new ParentComp();
|
// static ɵfac = () => new ParentComp();
|
||||||
// static ɵcmp = ɵɵdefineComponent({
|
// static ɵcmp = ɵɵdefineComponent({
|
||||||
// type: ParentComp,
|
// type: ParentComp,
|
||||||
// decls: 1,
|
// decls: 1,
|
||||||
|
@ -390,7 +390,7 @@ describe('component animations', () => {
|
||||||
describe('element discovery', () => {
|
describe('element discovery', () => {
|
||||||
it('should only monkey-patch immediate child nodes in a component', () => {
|
it('should only monkey-patch immediate child nodes in a component', () => {
|
||||||
class StructuredComp {
|
class StructuredComp {
|
||||||
static ngFactoryDef = () => new StructuredComp();
|
static ɵfac = () => new StructuredComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: StructuredComp,
|
type: StructuredComp,
|
||||||
selectors: [['structured-comp']],
|
selectors: [['structured-comp']],
|
||||||
|
@ -422,7 +422,7 @@ describe('element discovery', () => {
|
||||||
|
|
||||||
it('should only monkey-patch immediate child nodes in a sub component', () => {
|
it('should only monkey-patch immediate child nodes in a sub component', () => {
|
||||||
class ChildComp {
|
class ChildComp {
|
||||||
static ngFactoryDef = () => new ChildComp();
|
static ɵfac = () => new ChildComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ChildComp,
|
type: ChildComp,
|
||||||
selectors: [['child-comp']],
|
selectors: [['child-comp']],
|
||||||
|
@ -439,7 +439,7 @@ describe('element discovery', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ParentComp {
|
class ParentComp {
|
||||||
static ngFactoryDef = () => new ParentComp();
|
static ɵfac = () => new ParentComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ParentComp,
|
type: ParentComp,
|
||||||
selectors: [['parent-comp']],
|
selectors: [['parent-comp']],
|
||||||
|
@ -472,7 +472,7 @@ describe('element discovery', () => {
|
||||||
|
|
||||||
it('should only monkey-patch immediate child nodes in an embedded template container', () => {
|
it('should only monkey-patch immediate child nodes in an embedded template container', () => {
|
||||||
class StructuredComp {
|
class StructuredComp {
|
||||||
static ngFactoryDef = () => new StructuredComp();
|
static ɵfac = () => new StructuredComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: StructuredComp,
|
type: StructuredComp,
|
||||||
selectors: [['structured-comp']],
|
selectors: [['structured-comp']],
|
||||||
|
@ -522,7 +522,7 @@ describe('element discovery', () => {
|
||||||
|
|
||||||
it('should return a context object from a given dom node', () => {
|
it('should return a context object from a given dom node', () => {
|
||||||
class StructuredComp {
|
class StructuredComp {
|
||||||
static ngFactoryDef = () => new StructuredComp();
|
static ɵfac = () => new StructuredComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: StructuredComp,
|
type: StructuredComp,
|
||||||
selectors: [['structured-comp']],
|
selectors: [['structured-comp']],
|
||||||
|
@ -560,7 +560,7 @@ describe('element discovery', () => {
|
||||||
|
|
||||||
it('should cache the element context on a element was pre-emptively monkey-patched', () => {
|
it('should cache the element context on a element was pre-emptively monkey-patched', () => {
|
||||||
class StructuredComp {
|
class StructuredComp {
|
||||||
static ngFactoryDef = () => new StructuredComp();
|
static ɵfac = () => new StructuredComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: StructuredComp,
|
type: StructuredComp,
|
||||||
selectors: [['structured-comp']],
|
selectors: [['structured-comp']],
|
||||||
|
@ -592,7 +592,7 @@ describe('element discovery', () => {
|
||||||
it('should cache the element context on an intermediate element that isn\'t pre-emptively monkey-patched',
|
it('should cache the element context on an intermediate element that isn\'t pre-emptively monkey-patched',
|
||||||
() => {
|
() => {
|
||||||
class StructuredComp {
|
class StructuredComp {
|
||||||
static ngFactoryDef = () => new StructuredComp();
|
static ɵfac = () => new StructuredComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: StructuredComp,
|
type: StructuredComp,
|
||||||
selectors: [['structured-comp']],
|
selectors: [['structured-comp']],
|
||||||
|
@ -625,7 +625,7 @@ describe('element discovery', () => {
|
||||||
it('should be able to pull in element context data even if the element is decorated using styling',
|
it('should be able to pull in element context data even if the element is decorated using styling',
|
||||||
() => {
|
() => {
|
||||||
class StructuredComp {
|
class StructuredComp {
|
||||||
static ngFactoryDef = () => new StructuredComp();
|
static ɵfac = () => new StructuredComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: StructuredComp,
|
type: StructuredComp,
|
||||||
selectors: [['structured-comp']],
|
selectors: [['structured-comp']],
|
||||||
|
@ -673,7 +673,7 @@ describe('element discovery', () => {
|
||||||
</section>
|
</section>
|
||||||
*/
|
*/
|
||||||
class ProjectorComp {
|
class ProjectorComp {
|
||||||
static ngFactoryDef = () => new ProjectorComp();
|
static ɵfac = () => new ProjectorComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ProjectorComp,
|
type: ProjectorComp,
|
||||||
selectors: [['projector-comp']],
|
selectors: [['projector-comp']],
|
||||||
|
@ -696,7 +696,7 @@ describe('element discovery', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ParentComp {
|
class ParentComp {
|
||||||
static ngFactoryDef = () => new ParentComp();
|
static ɵfac = () => new ParentComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ParentComp,
|
type: ParentComp,
|
||||||
selectors: [['parent-comp']],
|
selectors: [['parent-comp']],
|
||||||
|
@ -770,7 +770,7 @@ describe('element discovery', () => {
|
||||||
it('should return `null` when an element context is retrieved that is a DOM node that was not created by Angular',
|
it('should return `null` when an element context is retrieved that is a DOM node that was not created by Angular',
|
||||||
() => {
|
() => {
|
||||||
class StructuredComp {
|
class StructuredComp {
|
||||||
static ngFactoryDef = () => new StructuredComp();
|
static ɵfac = () => new StructuredComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: StructuredComp,
|
type: StructuredComp,
|
||||||
selectors: [['structured-comp']],
|
selectors: [['structured-comp']],
|
||||||
|
@ -797,7 +797,7 @@ describe('element discovery', () => {
|
||||||
|
|
||||||
it('should by default monkey-patch the bootstrap component with context details', () => {
|
it('should by default monkey-patch the bootstrap component with context details', () => {
|
||||||
class StructuredComp {
|
class StructuredComp {
|
||||||
static ngFactoryDef = () => new StructuredComp();
|
static ɵfac = () => new StructuredComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: StructuredComp,
|
type: StructuredComp,
|
||||||
selectors: [['structured-comp']],
|
selectors: [['structured-comp']],
|
||||||
|
@ -836,22 +836,22 @@ describe('element discovery', () => {
|
||||||
let myDir3Instance: MyDir2|null = null;
|
let myDir3Instance: MyDir2|null = null;
|
||||||
|
|
||||||
class MyDir1 {
|
class MyDir1 {
|
||||||
static ngFactoryDef = () => myDir1Instance = new MyDir1();
|
static ɵfac = () => myDir1Instance = new MyDir1();
|
||||||
static ɵdir = ɵɵdefineDirective({type: MyDir1, selectors: [['', 'my-dir-1', '']]});
|
static ɵdir = ɵɵdefineDirective({type: MyDir1, selectors: [['', 'my-dir-1', '']]});
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyDir2 {
|
class MyDir2 {
|
||||||
static ngFactoryDef = () => myDir2Instance = new MyDir2();
|
static ɵfac = () => myDir2Instance = new MyDir2();
|
||||||
static ɵdir = ɵɵdefineDirective({type: MyDir2, selectors: [['', 'my-dir-2', '']]});
|
static ɵdir = ɵɵdefineDirective({type: MyDir2, selectors: [['', 'my-dir-2', '']]});
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyDir3 {
|
class MyDir3 {
|
||||||
static ngFactoryDef = () => myDir3Instance = new MyDir2();
|
static ɵfac = () => myDir3Instance = new MyDir2();
|
||||||
static ɵdir = ɵɵdefineDirective({type: MyDir3, selectors: [['', 'my-dir-3', '']]});
|
static ɵdir = ɵɵdefineDirective({type: MyDir3, selectors: [['', 'my-dir-3', '']]});
|
||||||
}
|
}
|
||||||
|
|
||||||
class StructuredComp {
|
class StructuredComp {
|
||||||
static ngFactoryDef = () => new StructuredComp();
|
static ɵfac = () => new StructuredComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: StructuredComp,
|
type: StructuredComp,
|
||||||
selectors: [['structured-comp']],
|
selectors: [['structured-comp']],
|
||||||
|
@ -917,17 +917,17 @@ describe('element discovery', () => {
|
||||||
let childComponentInstance: ChildComp|null = null;
|
let childComponentInstance: ChildComp|null = null;
|
||||||
|
|
||||||
class MyDir1 {
|
class MyDir1 {
|
||||||
static ngFactoryDef = () => myDir1Instance = new MyDir1();
|
static ɵfac = () => myDir1Instance = new MyDir1();
|
||||||
static ɵdir = ɵɵdefineDirective({type: MyDir1, selectors: [['', 'my-dir-1', '']]});
|
static ɵdir = ɵɵdefineDirective({type: MyDir1, selectors: [['', 'my-dir-1', '']]});
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyDir2 {
|
class MyDir2 {
|
||||||
static ngFactoryDef = () => myDir2Instance = new MyDir2();
|
static ɵfac = () => myDir2Instance = new MyDir2();
|
||||||
static ɵdir = ɵɵdefineDirective({type: MyDir2, selectors: [['', 'my-dir-2', '']]});
|
static ɵdir = ɵɵdefineDirective({type: MyDir2, selectors: [['', 'my-dir-2', '']]});
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChildComp {
|
class ChildComp {
|
||||||
static ngFactoryDef = () => childComponentInstance = new ChildComp();
|
static ɵfac = () => childComponentInstance = new ChildComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ChildComp,
|
type: ChildComp,
|
||||||
selectors: [['child-comp']],
|
selectors: [['child-comp']],
|
||||||
|
@ -942,7 +942,7 @@ describe('element discovery', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ParentComp {
|
class ParentComp {
|
||||||
static ngFactoryDef = () => new ParentComp();
|
static ɵfac = () => new ParentComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ParentComp,
|
type: ParentComp,
|
||||||
selectors: [['parent-comp']],
|
selectors: [['parent-comp']],
|
||||||
|
@ -1005,7 +1005,7 @@ describe('element discovery', () => {
|
||||||
it('should monkey-patch sub components with the view data and then replace them with the context result once a lookup occurs',
|
it('should monkey-patch sub components with the view data and then replace them with the context result once a lookup occurs',
|
||||||
() => {
|
() => {
|
||||||
class ChildComp {
|
class ChildComp {
|
||||||
static ngFactoryDef = () => new ChildComp();
|
static ɵfac = () => new ChildComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ChildComp,
|
type: ChildComp,
|
||||||
selectors: [['child-comp']],
|
selectors: [['child-comp']],
|
||||||
|
@ -1022,7 +1022,7 @@ describe('element discovery', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ParentComp {
|
class ParentComp {
|
||||||
static ngFactoryDef = () => new ParentComp();
|
static ɵfac = () => new ParentComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ParentComp,
|
type: ParentComp,
|
||||||
selectors: [['parent-comp']],
|
selectors: [['parent-comp']],
|
||||||
|
@ -1066,7 +1066,7 @@ describe('element discovery', () => {
|
||||||
describe('sanitization', () => {
|
describe('sanitization', () => {
|
||||||
it('should sanitize data using the provided sanitization interface', () => {
|
it('should sanitize data using the provided sanitization interface', () => {
|
||||||
class SanitizationComp {
|
class SanitizationComp {
|
||||||
static ngFactoryDef = () => new SanitizationComp();
|
static ɵfac = () => new SanitizationComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: SanitizationComp,
|
type: SanitizationComp,
|
||||||
selectors: [['sanitize-this']],
|
selectors: [['sanitize-this']],
|
||||||
|
@ -1108,7 +1108,7 @@ describe('sanitization', () => {
|
||||||
// @HostBinding()
|
// @HostBinding()
|
||||||
cite: any = 'http://cite-dir-value';
|
cite: any = 'http://cite-dir-value';
|
||||||
|
|
||||||
static ngFactoryDef = () => hostBindingDir = new UnsafeUrlHostBindingDir();
|
static ɵfac = () => hostBindingDir = new UnsafeUrlHostBindingDir();
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
type: UnsafeUrlHostBindingDir,
|
type: UnsafeUrlHostBindingDir,
|
||||||
selectors: [['', 'unsafeUrlHostBindingDir', '']],
|
selectors: [['', 'unsafeUrlHostBindingDir', '']],
|
||||||
|
@ -1124,7 +1124,7 @@ describe('sanitization', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
class SimpleComp {
|
class SimpleComp {
|
||||||
static ngFactoryDef = () => new SimpleComp();
|
static ɵfac = () => new SimpleComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: SimpleComp,
|
type: SimpleComp,
|
||||||
selectors: [['sanitize-this']],
|
selectors: [['sanitize-this']],
|
||||||
|
|
|
@ -34,7 +34,7 @@ ivyEnabled && describe('render3 jit', () => {
|
||||||
const SomeCmpAny = SomeCmp as any;
|
const SomeCmpAny = SomeCmp as any;
|
||||||
|
|
||||||
expect(SomeCmpAny.ɵcmp).toBeDefined();
|
expect(SomeCmpAny.ɵcmp).toBeDefined();
|
||||||
expect(SomeCmpAny.ngFactoryDef() instanceof SomeCmp).toBe(true);
|
expect(SomeCmpAny.ɵfac() instanceof SomeCmp).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('compiles an injectable with a type provider', () => {
|
it('compiles an injectable with a type provider', () => {
|
||||||
|
@ -242,7 +242,7 @@ ivyEnabled && describe('render3 jit', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const pipeDef = (P as any).ngPipeDef as PipeDef<P>;
|
const pipeDef = (P as any).ngPipeDef as PipeDef<P>;
|
||||||
const pipeFactory = (P as any).ngFactoryDef as FactoryFn<P>;
|
const pipeFactory = (P as any).ɵfac as FactoryFn<P>;
|
||||||
expect(pipeDef.name).toBe('test-pipe');
|
expect(pipeDef.name).toBe('test-pipe');
|
||||||
expect(pipeDef.pure).toBe(false, 'pipe should not be pure');
|
expect(pipeDef.pure).toBe(false, 'pipe should not be pure');
|
||||||
expect(pipeFactory() instanceof P)
|
expect(pipeFactory() instanceof P)
|
||||||
|
|
|
@ -55,7 +55,7 @@ describe('lifecycles', () => {
|
||||||
events.push(`${name}${this.val}`);
|
events.push(`${name}${this.val}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ngFactoryDef = () => new Component();
|
static ɵfac = () => new Component();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: Component,
|
type: Component,
|
||||||
selectors: [[name]],
|
selectors: [[name]],
|
||||||
|
@ -70,7 +70,7 @@ describe('lifecycles', () => {
|
||||||
class Directive {
|
class Directive {
|
||||||
ngOnInit() { events.push('dir'); }
|
ngOnInit() { events.push('dir'); }
|
||||||
|
|
||||||
static ngFactoryDef = () => new Directive();
|
static ɵfac = () => new Directive();
|
||||||
static ɵdir = ɵɵdefineDirective({type: Directive, selectors: [['', 'dir', '']]});
|
static ɵdir = ɵɵdefineDirective({type: Directive, selectors: [['', 'dir', '']]});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ describe('event listeners', () => {
|
||||||
|
|
||||||
onClick() { this.counter++; }
|
onClick() { this.counter++; }
|
||||||
|
|
||||||
static ngFactoryDef =
|
static ɵfac =
|
||||||
() => {
|
() => {
|
||||||
let comp = new MyComp();
|
let comp = new MyComp();
|
||||||
comps.push(comp);
|
comps.push(comp);
|
||||||
|
@ -60,7 +60,7 @@ describe('event listeners', () => {
|
||||||
/* @HostListener('body:click') */
|
/* @HostListener('body:click') */
|
||||||
onBodyClick() { events.push('component - body:click'); }
|
onBodyClick() { events.push('component - body:click'); }
|
||||||
|
|
||||||
static ngFactoryDef =
|
static ɵfac =
|
||||||
() => {
|
() => {
|
||||||
let comp = new MyCompWithGlobalListeners();
|
let comp = new MyCompWithGlobalListeners();
|
||||||
comps.push(comp);
|
comps.push(comp);
|
||||||
|
@ -98,9 +98,7 @@ describe('event listeners', () => {
|
||||||
/* @HostListener('body:click') */
|
/* @HostListener('body:click') */
|
||||||
onBodyClick() { events.push('directive - body:click'); }
|
onBodyClick() { events.push('directive - body:click'); }
|
||||||
|
|
||||||
static ngFactoryDef = function HostListenerDir_Factory() {
|
static ɵfac = function HostListenerDir_Factory() { return new GlobalHostListenerDir(); };
|
||||||
return new GlobalHostListenerDir();
|
|
||||||
};
|
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
type: GlobalHostListenerDir,
|
type: GlobalHostListenerDir,
|
||||||
selectors: [['', 'hostListenerDir', '']],
|
selectors: [['', 'hostListenerDir', '']],
|
||||||
|
@ -134,7 +132,7 @@ describe('event listeners', () => {
|
||||||
return this.handlerReturnValue;
|
return this.handlerReturnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ngFactoryDef = () => new PreventDefaultComp();
|
static ɵfac = () => new PreventDefaultComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: PreventDefaultComp,
|
type: PreventDefaultComp,
|
||||||
selectors: [['prevent-default-comp']],
|
selectors: [['prevent-default-comp']],
|
||||||
|
@ -325,7 +323,7 @@ describe('event listeners', () => {
|
||||||
|
|
||||||
onClick() { this.counter++; }
|
onClick() { this.counter++; }
|
||||||
|
|
||||||
static ngFactoryDef = () => new AppComp();
|
static ɵfac = () => new AppComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: AppComp,
|
type: AppComp,
|
||||||
selectors: [['app-comp']],
|
selectors: [['app-comp']],
|
||||||
|
@ -386,7 +384,7 @@ describe('event listeners', () => {
|
||||||
|
|
||||||
onClick(index: number) { this.counters[index]++; }
|
onClick(index: number) { this.counters[index]++; }
|
||||||
|
|
||||||
static ngFactoryDef = () => new AppComp();
|
static ɵfac = () => new AppComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: AppComp,
|
type: AppComp,
|
||||||
selectors: [['app-comp']],
|
selectors: [['app-comp']],
|
||||||
|
@ -450,7 +448,7 @@ describe('event listeners', () => {
|
||||||
|
|
||||||
onClick(index: number) { this.counters[index]++; }
|
onClick(index: number) { this.counters[index]++; }
|
||||||
|
|
||||||
static ngFactoryDef = () => new AppComp();
|
static ɵfac = () => new AppComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: AppComp,
|
type: AppComp,
|
||||||
selectors: [['app-comp']],
|
selectors: [['app-comp']],
|
||||||
|
@ -529,7 +527,7 @@ describe('event listeners', () => {
|
||||||
/* @HostListener('click') */
|
/* @HostListener('click') */
|
||||||
onClick() { events.push('click!'); }
|
onClick() { events.push('click!'); }
|
||||||
|
|
||||||
static ngFactoryDef = () => { return new MyComp(); };
|
static ɵfac = () => { return new MyComp(); };
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: MyComp,
|
type: MyComp,
|
||||||
selectors: [['comp']],
|
selectors: [['comp']],
|
||||||
|
@ -580,7 +578,7 @@ describe('event listeners', () => {
|
||||||
/* @HostListener('click') */
|
/* @HostListener('click') */
|
||||||
onClick() { events.push('click!'); }
|
onClick() { events.push('click!'); }
|
||||||
|
|
||||||
static ngFactoryDef = function HostListenerDir_Factory() { return new HostListenerDir(); };
|
static ɵfac = function HostListenerDir_Factory() { return new HostListenerDir(); };
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
type: HostListenerDir,
|
type: HostListenerDir,
|
||||||
selectors: [['', 'hostListenerDir', '']],
|
selectors: [['', 'hostListenerDir', '']],
|
||||||
|
@ -632,7 +630,7 @@ describe('event listeners', () => {
|
||||||
|
|
||||||
onClick(a: any, b: any) { this.counter += a + b; }
|
onClick(a: any, b: any) { this.counter += a + b; }
|
||||||
|
|
||||||
static ngFactoryDef = () => new MyComp();
|
static ɵfac = () => new MyComp();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: MyComp,
|
type: MyComp,
|
||||||
selectors: [['comp']],
|
selectors: [['comp']],
|
||||||
|
@ -913,7 +911,7 @@ describe('event listeners', () => {
|
||||||
|
|
||||||
onClick(comp: any) { this.comp = comp; }
|
onClick(comp: any) { this.comp = comp; }
|
||||||
|
|
||||||
static ngFactoryDef = () => new App();
|
static ɵfac = () => new App();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: App,
|
type: App,
|
||||||
selectors: [['app']],
|
selectors: [['app']],
|
||||||
|
|
|
@ -21,7 +21,7 @@ describe('outputs', () => {
|
||||||
change = new EventEmitter();
|
change = new EventEmitter();
|
||||||
resetStream = new EventEmitter();
|
resetStream = new EventEmitter();
|
||||||
|
|
||||||
static ngFactoryDef = () => buttonToggle = new ButtonToggle();
|
static ɵfac = () => buttonToggle = new ButtonToggle();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ButtonToggle,
|
type: ButtonToggle,
|
||||||
selectors: [['button-toggle']],
|
selectors: [['button-toggle']],
|
||||||
|
@ -37,7 +37,7 @@ describe('outputs', () => {
|
||||||
class OtherDir {
|
class OtherDir {
|
||||||
changeStream = new EventEmitter();
|
changeStream = new EventEmitter();
|
||||||
|
|
||||||
static ngFactoryDef = () => otherDir = new OtherDir;
|
static ɵfac = () => otherDir = new OtherDir;
|
||||||
static ɵdir = ɵɵdefineDirective(
|
static ɵdir = ɵɵdefineDirective(
|
||||||
{type: OtherDir, selectors: [['', 'otherDir', '']], outputs: {changeStream: 'change'}});
|
{type: OtherDir, selectors: [['', 'otherDir', '']], outputs: {changeStream: 'change'}});
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ describe('pipe', () => {
|
||||||
class WrappingPipe implements PipeTransform {
|
class WrappingPipe implements PipeTransform {
|
||||||
transform(value: any) { return new WrappedValue('Bar'); }
|
transform(value: any) { return new WrappedValue('Bar'); }
|
||||||
|
|
||||||
static ngFactoryDef = function WrappingPipe_Factory() { return new WrappingPipe(); };
|
static ɵfac = function WrappingPipe_Factory() { return new WrappingPipe(); };
|
||||||
static ngPipeDef = ɵɵdefinePipe({name: 'wrappingPipe', type: WrappingPipe, pure: false});
|
static ngPipeDef = ɵɵdefinePipe({name: 'wrappingPipe', type: WrappingPipe, pure: false});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -867,7 +867,7 @@ describe('providers', () => {
|
||||||
class Repeated {
|
class Repeated {
|
||||||
constructor(private s: String, private n: Number) {}
|
constructor(private s: String, private n: Number) {}
|
||||||
|
|
||||||
static ngFactoryDef =
|
static ɵfac =
|
||||||
() => { return new Repeated(ɵɵdirectiveInject(String), ɵɵdirectiveInject(Number)); }
|
() => { return new Repeated(ɵɵdirectiveInject(String), ɵɵdirectiveInject(Number)); }
|
||||||
|
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
|
@ -900,7 +900,7 @@ describe('providers', () => {
|
||||||
[{provide: String, useValue: 'foo'}, {provide: Number, useValue: 2, multi: true}],
|
[{provide: String, useValue: 'foo'}, {provide: Number, useValue: 2, multi: true}],
|
||||||
})
|
})
|
||||||
class ComponentWithProviders {
|
class ComponentWithProviders {
|
||||||
static ngFactoryDef = () => new ComponentWithProviders();
|
static ɵfac = () => new ComponentWithProviders();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ComponentWithProviders,
|
type: ComponentWithProviders,
|
||||||
selectors: [['component-with-providers']],
|
selectors: [['component-with-providers']],
|
||||||
|
@ -953,7 +953,7 @@ describe('providers', () => {
|
||||||
class Repeated {
|
class Repeated {
|
||||||
constructor(private s: String, private n: Number) {}
|
constructor(private s: String, private n: Number) {}
|
||||||
|
|
||||||
static ngFactoryDef =
|
static ɵfac =
|
||||||
() => { return new Repeated(ɵɵdirectiveInject(String), ɵɵdirectiveInject(Number)); }
|
() => { return new Repeated(ɵɵdirectiveInject(String), ɵɵdirectiveInject(Number)); }
|
||||||
|
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
|
@ -989,7 +989,7 @@ describe('providers', () => {
|
||||||
viewProviders: [{provide: toString, useValue: 'foo'}],
|
viewProviders: [{provide: toString, useValue: 'foo'}],
|
||||||
})
|
})
|
||||||
class ComponentWithProviders {
|
class ComponentWithProviders {
|
||||||
static ngFactoryDef = () => new ComponentWithProviders();
|
static ɵfac = () => new ComponentWithProviders();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ComponentWithProviders,
|
type: ComponentWithProviders,
|
||||||
selectors: [['component-with-providers']],
|
selectors: [['component-with-providers']],
|
||||||
|
@ -1038,7 +1038,7 @@ describe('providers', () => {
|
||||||
class EmbeddedComponent {
|
class EmbeddedComponent {
|
||||||
constructor(private s: String) {}
|
constructor(private s: String) {}
|
||||||
|
|
||||||
static ngFactoryDef = () => new EmbeddedComponent(ɵɵdirectiveInject(String));
|
static ɵfac = () => new EmbeddedComponent(ɵɵdirectiveInject(String));
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: EmbeddedComponent,
|
type: EmbeddedComponent,
|
||||||
selectors: [['embedded-cmp']],
|
selectors: [['embedded-cmp']],
|
||||||
|
@ -1059,7 +1059,7 @@ describe('providers', () => {
|
||||||
class HostComponent {
|
class HostComponent {
|
||||||
constructor(public vcref: ViewContainerRef, public cfr: ComponentFactoryResolver) {}
|
constructor(public vcref: ViewContainerRef, public cfr: ComponentFactoryResolver) {}
|
||||||
|
|
||||||
static ngFactoryDef = () => hostComponent = new HostComponent(
|
static ɵfac = () => hostComponent = new HostComponent(
|
||||||
ɵɵdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver())
|
ɵɵdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver())
|
||||||
|
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
|
@ -1085,7 +1085,7 @@ describe('providers', () => {
|
||||||
class AppComponent {
|
class AppComponent {
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
static ngFactoryDef = () => new AppComponent();
|
static ɵfac = () => new AppComponent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: AppComponent,
|
type: AppComponent,
|
||||||
selectors: [['app-cmp']],
|
selectors: [['app-cmp']],
|
||||||
|
@ -1247,7 +1247,7 @@ describe('providers', () => {
|
||||||
class MyComponent {
|
class MyComponent {
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
static ngFactoryDef = () => new MyComponent();
|
static ɵfac = () => new MyComponent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: MyComponent,
|
type: MyComponent,
|
||||||
selectors: [['my-cmp']],
|
selectors: [['my-cmp']],
|
||||||
|
@ -1274,7 +1274,7 @@ describe('providers', () => {
|
||||||
class AppComponent {
|
class AppComponent {
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
static ngFactoryDef = () => new AppComponent();
|
static ɵfac = () => new AppComponent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: AppComponent,
|
type: AppComponent,
|
||||||
selectors: [['app-cmp']],
|
selectors: [['app-cmp']],
|
||||||
|
@ -1337,7 +1337,7 @@ describe('providers', () => {
|
||||||
class MyComponent {
|
class MyComponent {
|
||||||
constructor(foo: InjectableWithLifeCycleHooks) {}
|
constructor(foo: InjectableWithLifeCycleHooks) {}
|
||||||
|
|
||||||
static ngFactoryDef =
|
static ɵfac =
|
||||||
() => { return new MyComponent(ɵɵdirectiveInject(InjectableWithLifeCycleHooks)); }
|
() => { return new MyComponent(ɵɵdirectiveInject(InjectableWithLifeCycleHooks)); }
|
||||||
|
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
|
@ -1366,7 +1366,7 @@ describe('providers', () => {
|
||||||
class App {
|
class App {
|
||||||
public condition = true;
|
public condition = true;
|
||||||
|
|
||||||
static ngFactoryDef = () => new App();
|
static ɵfac = () => new App();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: App,
|
type: App,
|
||||||
selectors: [['app-cmp']],
|
selectors: [['app-cmp']],
|
||||||
|
@ -1441,7 +1441,7 @@ function expectProvidersScenario(defs: {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ViewChildComponent {
|
class ViewChildComponent {
|
||||||
static ngFactoryDef = () => testComponentInjection(defs.viewChild, new ViewChildComponent());
|
static ɵfac = () => testComponentInjection(defs.viewChild, new ViewChildComponent());
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ViewChildComponent,
|
type: ViewChildComponent,
|
||||||
selectors: [['view-child']],
|
selectors: [['view-child']],
|
||||||
|
@ -1458,7 +1458,7 @@ function expectProvidersScenario(defs: {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ViewChildDirective {
|
class ViewChildDirective {
|
||||||
static ngFactoryDef = () => testDirectiveInjection(defs.viewChild, new ViewChildDirective());
|
static ɵfac = () => testDirectiveInjection(defs.viewChild, new ViewChildDirective());
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
type: ViewChildDirective,
|
type: ViewChildDirective,
|
||||||
selectors: [['view-child']],
|
selectors: [['view-child']],
|
||||||
|
@ -1467,7 +1467,7 @@ function expectProvidersScenario(defs: {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ContentChildComponent {
|
class ContentChildComponent {
|
||||||
static ngFactoryDef =
|
static ɵfac =
|
||||||
() => { return testComponentInjection(defs.contentChild, new ContentChildComponent()); }
|
() => { return testComponentInjection(defs.contentChild, new ContentChildComponent()); }
|
||||||
|
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
|
@ -1487,7 +1487,7 @@ function expectProvidersScenario(defs: {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ContentChildDirective {
|
class ContentChildDirective {
|
||||||
static ngFactoryDef =
|
static ɵfac =
|
||||||
() => { return testDirectiveInjection(defs.contentChild, new ContentChildDirective()); }
|
() => { return testDirectiveInjection(defs.contentChild, new ContentChildDirective()); }
|
||||||
|
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
|
@ -1500,7 +1500,7 @@ function expectProvidersScenario(defs: {
|
||||||
|
|
||||||
|
|
||||||
class ParentComponent {
|
class ParentComponent {
|
||||||
static ngFactoryDef = () => testComponentInjection(defs.parent, new ParentComponent());
|
static ɵfac = () => testComponentInjection(defs.parent, new ParentComponent());
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ParentComponent,
|
type: ParentComponent,
|
||||||
selectors: [['parent']],
|
selectors: [['parent']],
|
||||||
|
@ -1518,7 +1518,7 @@ function expectProvidersScenario(defs: {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ParentDirective {
|
class ParentDirective {
|
||||||
static ngFactoryDef = () => testDirectiveInjection(defs.parent, new ParentDirective());
|
static ɵfac = () => testDirectiveInjection(defs.parent, new ParentDirective());
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
type: ParentDirective,
|
type: ParentDirective,
|
||||||
selectors: [['parent']],
|
selectors: [['parent']],
|
||||||
|
@ -1527,7 +1527,7 @@ function expectProvidersScenario(defs: {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ParentDirective2 {
|
class ParentDirective2 {
|
||||||
static ngFactoryDef = () => testDirectiveInjection(defs.parent, new ParentDirective2());
|
static ɵfac = () => testDirectiveInjection(defs.parent, new ParentDirective2());
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
type: ParentDirective2,
|
type: ParentDirective2,
|
||||||
selectors: [['parent']],
|
selectors: [['parent']],
|
||||||
|
@ -1537,7 +1537,7 @@ function expectProvidersScenario(defs: {
|
||||||
|
|
||||||
|
|
||||||
class App {
|
class App {
|
||||||
static ngFactoryDef = () => testComponentInjection(defs.app, new App());
|
static ɵfac = () => testComponentInjection(defs.app, new App());
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: App,
|
type: App,
|
||||||
selectors: [['app']],
|
selectors: [['app']],
|
||||||
|
|
|
@ -19,7 +19,7 @@ describe('object literals', () => {
|
||||||
// TODO(issue/24571): remove '!'.
|
// TODO(issue/24571): remove '!'.
|
||||||
config !: {[key: string]: any};
|
config !: {[key: string]: any};
|
||||||
|
|
||||||
static ngFactoryDef = function ObjectComp_Factory() { return objectComp = new ObjectComp(); };
|
static ɵfac = function ObjectComp_Factory() { return objectComp = new ObjectComp(); };
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ObjectComp,
|
type: ObjectComp,
|
||||||
selectors: [['object-comp']],
|
selectors: [['object-comp']],
|
||||||
|
|
|
@ -220,7 +220,7 @@ describe('query', () => {
|
||||||
class MyDirective {
|
class MyDirective {
|
||||||
constructor(public service: Service) {}
|
constructor(public service: Service) {}
|
||||||
|
|
||||||
static ngFactoryDef = function MyDirective_Factory() {
|
static ɵfac = function MyDirective_Factory() {
|
||||||
return directive = new MyDirective(ɵɵdirectiveInject(Service));
|
return directive = new MyDirective(ɵɵdirectiveInject(Service));
|
||||||
};
|
};
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
|
@ -248,7 +248,7 @@ describe('query', () => {
|
||||||
service?: Service;
|
service?: Service;
|
||||||
alias?: Alias;
|
alias?: Alias;
|
||||||
|
|
||||||
static ngFactoryDef = function App_Factory() { return new App(); };
|
static ɵfac = function App_Factory() { return new App(); };
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: App,
|
type: App,
|
||||||
selectors: [['app']],
|
selectors: [['app']],
|
||||||
|
@ -294,7 +294,7 @@ describe('query', () => {
|
||||||
class App {
|
class App {
|
||||||
service?: Service;
|
service?: Service;
|
||||||
|
|
||||||
static ngFactoryDef = function App_Factory() { return new App(); };
|
static ɵfac = function App_Factory() { return new App(); };
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: App,
|
type: App,
|
||||||
selectors: [['app']],
|
selectors: [['app']],
|
||||||
|
@ -838,7 +838,7 @@ describe('query', () => {
|
||||||
let childInstance: Child;
|
let childInstance: Child;
|
||||||
|
|
||||||
class Child {
|
class Child {
|
||||||
static ngFactoryDef = () => childInstance = new Child();
|
static ɵfac = () => childInstance = new Child();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: Child,
|
type: Child,
|
||||||
selectors: [['child']],
|
selectors: [['child']],
|
||||||
|
@ -1420,7 +1420,7 @@ describe('query', () => {
|
||||||
this.vcr.createEmbeddedView(this.temp);
|
this.vcr.createEmbeddedView(this.temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ngFactoryDef = () => new SomeDir(
|
static ɵfac = () => new SomeDir(
|
||||||
ɵɵdirectiveInject(ViewContainerRef as any), ɵɵdirectiveInject(TemplateRef as any))
|
ɵɵdirectiveInject(ViewContainerRef as any), ɵɵdirectiveInject(TemplateRef as any))
|
||||||
|
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
|
@ -1481,7 +1481,7 @@ describe('query', () => {
|
||||||
this.contentCheckedQuerySnapshot = this.foos ? this.foos.length : 0;
|
this.contentCheckedQuerySnapshot = this.foos ? this.foos.length : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ngFactoryDef = () => withContentInstance = new WithContentDirective();
|
static ɵfac = () => withContentInstance = new WithContentDirective();
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
type: WithContentDirective,
|
type: WithContentDirective,
|
||||||
selectors: [['', 'with-content', '']],
|
selectors: [['', 'with-content', '']],
|
||||||
|
@ -1679,7 +1679,7 @@ describe('query', () => {
|
||||||
it('should report results to appropriate queries where deep content queries are nested', () => {
|
it('should report results to appropriate queries where deep content queries are nested', () => {
|
||||||
class QueryDirective {
|
class QueryDirective {
|
||||||
fooBars: any;
|
fooBars: any;
|
||||||
static ngFactoryDef = () => new QueryDirective();
|
static ɵfac = () => new QueryDirective();
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
type: QueryDirective,
|
type: QueryDirective,
|
||||||
selectors: [['', 'query', '']],
|
selectors: [['', 'query', '']],
|
||||||
|
@ -1745,7 +1745,7 @@ describe('query', () => {
|
||||||
|
|
||||||
class QueryDirective {
|
class QueryDirective {
|
||||||
fooBars: any;
|
fooBars: any;
|
||||||
static ngFactoryDef = () => new QueryDirective();
|
static ɵfac = () => new QueryDirective();
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
type: QueryDirective,
|
type: QueryDirective,
|
||||||
selectors: [['', 'query', '']],
|
selectors: [['', 'query', '']],
|
||||||
|
@ -1802,7 +1802,7 @@ describe('query', () => {
|
||||||
|
|
||||||
class QueryDirective {
|
class QueryDirective {
|
||||||
fooBars: any;
|
fooBars: any;
|
||||||
static ngFactoryDef = () => new QueryDirective();
|
static ɵfac = () => new QueryDirective();
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
type: QueryDirective,
|
type: QueryDirective,
|
||||||
selectors: [['', 'query', '']],
|
selectors: [['', 'query', '']],
|
||||||
|
@ -1863,7 +1863,7 @@ describe('query', () => {
|
||||||
() => {
|
() => {
|
||||||
class ShallowQueryDirective {
|
class ShallowQueryDirective {
|
||||||
foos: any;
|
foos: any;
|
||||||
static ngFactoryDef = () => new ShallowQueryDirective();
|
static ɵfac = () => new ShallowQueryDirective();
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
type: ShallowQueryDirective,
|
type: ShallowQueryDirective,
|
||||||
selectors: [['', 'shallow-query', '']],
|
selectors: [['', 'shallow-query', '']],
|
||||||
|
@ -1884,7 +1884,7 @@ describe('query', () => {
|
||||||
|
|
||||||
class DeepQueryDirective {
|
class DeepQueryDirective {
|
||||||
foos: any;
|
foos: any;
|
||||||
static ngFactoryDef = () => new DeepQueryDirective();
|
static ɵfac = () => new DeepQueryDirective();
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
type: DeepQueryDirective,
|
type: DeepQueryDirective,
|
||||||
selectors: [['', 'deep-query', '']],
|
selectors: [['', 'deep-query', '']],
|
||||||
|
@ -1946,7 +1946,7 @@ describe('query', () => {
|
||||||
class TextDirective {
|
class TextDirective {
|
||||||
value !: string;
|
value !: string;
|
||||||
|
|
||||||
static ngFactoryDef = () => new TextDirective();
|
static ɵfac = () => new TextDirective();
|
||||||
static ɵdir = ɵɵdefineDirective(
|
static ɵdir = ɵɵdefineDirective(
|
||||||
{type: TextDirective, selectors: [['', 'text', '']], inputs: {value: 'text'}});
|
{type: TextDirective, selectors: [['', 'text', '']], inputs: {value: 'text'}});
|
||||||
}
|
}
|
||||||
|
@ -1958,7 +1958,7 @@ describe('query', () => {
|
||||||
// @ContentChildren(TextDirective)
|
// @ContentChildren(TextDirective)
|
||||||
texts !: QueryList<TextDirective>;
|
texts !: QueryList<TextDirective>;
|
||||||
|
|
||||||
static ngFactoryDef = () => contentQueryDirective = new ContentQueryDirective();
|
static ɵfac = () => contentQueryDirective = new ContentQueryDirective();
|
||||||
static ɵcmp = ɵɵdefineDirective({
|
static ɵcmp = ɵɵdefineDirective({
|
||||||
type: ContentQueryDirective,
|
type: ContentQueryDirective,
|
||||||
selectors: [['', 'content-query', '']],
|
selectors: [['', 'content-query', '']],
|
||||||
|
@ -2029,7 +2029,7 @@ describe('query', () => {
|
||||||
// @ViewChildren(TextDirective)
|
// @ViewChildren(TextDirective)
|
||||||
texts !: QueryList<TextDirective>;
|
texts !: QueryList<TextDirective>;
|
||||||
|
|
||||||
static ngFactoryDef = () => new ViewQueryComponent();
|
static ɵfac = () => new ViewQueryComponent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: ViewQueryComponent,
|
type: ViewQueryComponent,
|
||||||
selectors: [['view-query']],
|
selectors: [['view-query']],
|
||||||
|
|
|
@ -374,7 +374,7 @@ export function createComponent(
|
||||||
consts: TAttributes[] = []): ComponentType<any> {
|
consts: TAttributes[] = []): ComponentType<any> {
|
||||||
return class Component {
|
return class Component {
|
||||||
value: any;
|
value: any;
|
||||||
static ngFactoryDef = () => new Component;
|
static ɵfac = () => new Component;
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: Component,
|
type: Component,
|
||||||
selectors: [[name]],
|
selectors: [[name]],
|
||||||
|
@ -394,7 +394,7 @@ export function createComponent(
|
||||||
export function createDirective(
|
export function createDirective(
|
||||||
name: string, {exportAs}: {exportAs?: string[]} = {}): DirectiveType<any> {
|
name: string, {exportAs}: {exportAs?: string[]} = {}): DirectiveType<any> {
|
||||||
return class Directive {
|
return class Directive {
|
||||||
static ngFactoryDef = () => new Directive();
|
static ɵfac = () => new Directive();
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
type: Directive,
|
type: Directive,
|
||||||
selectors: [['', name, '']],
|
selectors: [['', name, '']],
|
||||||
|
|
|
@ -26,7 +26,7 @@ describe('renderer factory lifecycle', () => {
|
||||||
rendererFactory.end = () => logs.push('end');
|
rendererFactory.end = () => logs.push('end');
|
||||||
|
|
||||||
class SomeComponent {
|
class SomeComponent {
|
||||||
static ngFactoryDef = () => new SomeComponent;
|
static ɵfac = () => new SomeComponent;
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: SomeComponent,
|
type: SomeComponent,
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
@ -46,7 +46,7 @@ describe('renderer factory lifecycle', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
class SomeComponentWhichThrows {
|
class SomeComponentWhichThrows {
|
||||||
static ngFactoryDef = () => new SomeComponentWhichThrows;
|
static ɵfac = () => new SomeComponentWhichThrows;
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: SomeComponentWhichThrows,
|
type: SomeComponentWhichThrows,
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
@ -150,7 +150,7 @@ describe('Renderer2 destruction hooks', () => {
|
||||||
|
|
||||||
it('should call renderer.destroy for each component destroyed', () => {
|
it('should call renderer.destroy for each component destroyed', () => {
|
||||||
class SimpleComponent {
|
class SimpleComponent {
|
||||||
static ngFactoryDef = () => new SimpleComponent;
|
static ɵfac = () => new SimpleComponent;
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: SimpleComponent,
|
type: SimpleComponent,
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
|
|
@ -29,7 +29,7 @@ describe('ViewContainerRef', () => {
|
||||||
beforeEach(() => directiveInstance = null);
|
beforeEach(() => directiveInstance = null);
|
||||||
|
|
||||||
class DirectiveWithVCRef {
|
class DirectiveWithVCRef {
|
||||||
static ngFactoryDef = () => directiveInstance = new DirectiveWithVCRef(
|
static ɵfac = () => directiveInstance = new DirectiveWithVCRef(
|
||||||
ɵɵdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver())
|
ɵɵdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver())
|
||||||
|
|
||||||
static ɵdir = ɵɵdefineDirective({
|
static ɵdir = ɵɵdefineDirective({
|
||||||
|
@ -57,7 +57,7 @@ describe('ViewContainerRef', () => {
|
||||||
let directiveInstances: TestDirective[] = [];
|
let directiveInstances: TestDirective[] = [];
|
||||||
|
|
||||||
class TestDirective {
|
class TestDirective {
|
||||||
static ngFactoryDef =
|
static ɵfac =
|
||||||
() => {
|
() => {
|
||||||
const instance = new TestDirective(
|
const instance = new TestDirective(
|
||||||
ɵɵdirectiveInject(ViewContainerRef as any),
|
ɵɵdirectiveInject(ViewContainerRef as any),
|
||||||
|
@ -101,7 +101,7 @@ describe('ViewContainerRef', () => {
|
||||||
class TestComponent {
|
class TestComponent {
|
||||||
// TODO(issue/24571): remove '!'.
|
// TODO(issue/24571): remove '!'.
|
||||||
testDir !: TestDirective;
|
testDir !: TestDirective;
|
||||||
static ngFactoryDef = () => new TestComponent();
|
static ɵfac = () => new TestComponent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: TestComponent,
|
type: TestComponent,
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
@ -137,7 +137,7 @@ describe('ViewContainerRef', () => {
|
||||||
let directiveInstance: TestDirective;
|
let directiveInstance: TestDirective;
|
||||||
|
|
||||||
class TestDirective {
|
class TestDirective {
|
||||||
static ngFactoryDef = () => directiveInstance = new TestDirective(
|
static ɵfac = () => directiveInstance = new TestDirective(
|
||||||
ɵɵdirectiveInject(ViewContainerRef as any), ɵɵdirectiveInject(TemplateRef as any))
|
ɵɵdirectiveInject(ViewContainerRef as any), ɵɵdirectiveInject(TemplateRef as any))
|
||||||
|
|
||||||
static ɵdir =
|
static ɵdir =
|
||||||
|
@ -173,7 +173,7 @@ describe('ViewContainerRef', () => {
|
||||||
condition = false;
|
condition = false;
|
||||||
// TODO(issue/24571): remove '!'.
|
// TODO(issue/24571): remove '!'.
|
||||||
testDir !: TestDirective;
|
testDir !: TestDirective;
|
||||||
static ngFactoryDef = () => new TestComponent();
|
static ɵfac = () => new TestComponent();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: TestComponent,
|
type: TestComponent,
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
@ -241,7 +241,7 @@ describe('ViewContainerRef', () => {
|
||||||
class AppComp {
|
class AppComp {
|
||||||
constructor(public vcr: ViewContainerRef, public cfr: ComponentFactoryResolver) {}
|
constructor(public vcr: ViewContainerRef, public cfr: ComponentFactoryResolver) {}
|
||||||
|
|
||||||
static ngFactoryDef =
|
static ɵfac =
|
||||||
() => {
|
() => {
|
||||||
return new AppComp(
|
return new AppComp(
|
||||||
ɵɵdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver());
|
ɵɵdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver());
|
||||||
|
@ -261,7 +261,7 @@ describe('ViewContainerRef', () => {
|
||||||
|
|
||||||
ngDoCheck() { this.doCheckCount++; }
|
ngDoCheck() { this.doCheckCount++; }
|
||||||
|
|
||||||
static ngFactoryDef = () => dynamicComp = new DynamicComp();
|
static ɵfac = () => dynamicComp = new DynamicComp();
|
||||||
|
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: DynamicComp,
|
type: DynamicComp,
|
||||||
|
@ -365,7 +365,7 @@ describe('ViewContainerRef', () => {
|
||||||
|
|
||||||
@Component({selector: 'app', template: ''})
|
@Component({selector: 'app', template: ''})
|
||||||
class AppCmpt {
|
class AppCmpt {
|
||||||
static ngFactoryDef = () =>
|
static ɵfac = () =>
|
||||||
new AppCmpt(ɵɵdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver())
|
new AppCmpt(ɵɵdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver())
|
||||||
|
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
|
@ -435,7 +435,7 @@ describe('ViewContainerRef', () => {
|
||||||
// @ViewChildren('foo')
|
// @ViewChildren('foo')
|
||||||
foo !: QueryList<any>;
|
foo !: QueryList<any>;
|
||||||
|
|
||||||
static ngFactoryDef = () => dynamicComp = new DynamicCompWithViewQueries();
|
static ɵfac = () => dynamicComp = new DynamicCompWithViewQueries();
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
type: DynamicCompWithViewQueries,
|
type: DynamicCompWithViewQueries,
|
||||||
selectors: [['dynamic-cmpt-with-view-queries']],
|
selectors: [['dynamic-cmpt-with-view-queries']],
|
||||||
|
@ -482,7 +482,7 @@ describe('ViewContainerRef', () => {
|
||||||
|
|
||||||
// We want the ViewRef, so we rely on the knowledge that `ViewRef` is actually given
|
// We want the ViewRef, so we rely on the knowledge that `ViewRef` is actually given
|
||||||
// when injecting `ChangeDetectorRef`.
|
// when injecting `ChangeDetectorRef`.
|
||||||
static ngFactoryDef = () =>
|
static ɵfac = () =>
|
||||||
new CompWithListenerThatDestroysItself(ɵɵdirectiveInject(ChangeDetectorRef as any))
|
new CompWithListenerThatDestroysItself(ɵɵdirectiveInject(ChangeDetectorRef as any))
|
||||||
|
|
||||||
static ɵcmp = ɵɵdefineComponent({
|
static ɵcmp = ɵɵdefineComponent({
|
||||||
|
|
|
@ -505,7 +505,7 @@ describe('TestBed', () => {
|
||||||
*/
|
*/
|
||||||
const getAOTCompiledComponent = () => {
|
const getAOTCompiledComponent = () => {
|
||||||
class ComponentClass {
|
class ComponentClass {
|
||||||
static ngFactoryDef = () => new ComponentClass();
|
static ɵfac = () => new ComponentClass();
|
||||||
static ɵcmp = defineComponent({
|
static ɵcmp = defineComponent({
|
||||||
type: ComponentClass,
|
type: ComponentClass,
|
||||||
selectors: [['comp']],
|
selectors: [['comp']],
|
||||||
|
|
|
@ -224,8 +224,8 @@ export declare class NgClassBase {
|
||||||
getValue(): {
|
getValue(): {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
} | null;
|
} | null;
|
||||||
static ngFactoryDef: any;
|
|
||||||
static ɵdir: any;
|
static ɵdir: any;
|
||||||
|
static ɵfac: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export declare class NgComponentOutlet implements OnChanges, OnDestroy {
|
export declare class NgComponentOutlet implements OnChanges, OnDestroy {
|
||||||
|
@ -309,8 +309,8 @@ export declare class NgStyleBase {
|
||||||
getValue(): {
|
getValue(): {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
} | null;
|
} | null;
|
||||||
static ngFactory: any;
|
|
||||||
static ɵdir: any;
|
static ɵdir: any;
|
||||||
|
static ɵfac: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export declare class NgSwitch {
|
export declare class NgSwitch {
|
||||||
|
|
Loading…
Reference in New Issue