refactor(ivy): prefix all generated instructions (#29692)
- Updates all instructions to be prefixed with the Greek delta symbol PR Close #29692
This commit is contained in:
@ -152,11 +152,11 @@ describe('Renderer', () => {
|
||||
const addDefinitionsSpy = renderer.addDefinitions as jasmine.Spy;
|
||||
expect(addDefinitionsSpy.calls.first().args[2])
|
||||
.toEqual(
|
||||
`A.ngComponentDef = ɵngcc0.ɵdefineComponent({ type: A, selectors: [["a"]], factory: function A_Factory(t) { return new (t || A)(); }, consts: 1, vars: 1, template: function A_Template(rf, ctx) { if (rf & 1) {
|
||||
ɵngcc0.ɵtext(0);
|
||||
`A.ngComponentDef = ɵngcc0.ΔdefineComponent({ type: A, selectors: [["a"]], factory: function A_Factory(t) { return new (t || A)(); }, consts: 1, vars: 1, template: function A_Template(rf, ctx) { if (rf & 1) {
|
||||
ɵngcc0.Δtext(0);
|
||||
} if (rf & 2) {
|
||||
ɵngcc0.ɵselect(0);
|
||||
ɵngcc0.ɵtextBinding(0, ɵngcc0.ɵinterpolation1("", ctx.person.name, ""));
|
||||
ɵngcc0.Δselect(0);
|
||||
ɵngcc0.ΔtextBinding(0, ɵngcc0.Δinterpolation1("", ctx.person.name, ""));
|
||||
} }, encapsulation: 2 });
|
||||
/*@__PURE__*/ ɵngcc0.ɵsetClassMetadata(A, [{
|
||||
type: Component,
|
||||
@ -197,7 +197,7 @@ describe('Renderer', () => {
|
||||
}));
|
||||
expect(addDefinitionsSpy.calls.first().args[2])
|
||||
.toEqual(
|
||||
`A.ngDirectiveDef = ɵngcc0.ɵdefineDirective({ type: A, selectors: [["", "a", ""]], factory: function A_Factory(t) { return new (t || A)(); } });
|
||||
`A.ngDirectiveDef = ɵngcc0.ΔdefineDirective({ type: A, selectors: [["", "a", ""]], factory: function A_Factory(t) { return new (t || A)(); } });
|
||||
/*@__PURE__*/ ɵngcc0.ɵsetClassMetadata(A, [{
|
||||
type: Directive,
|
||||
args: [{ selector: '[a]' }]
|
||||
@ -331,7 +331,7 @@ describe('Renderer', () => {
|
||||
const typingsFile = result.find(f => f.path === '/typings/file.d.ts') !;
|
||||
expect(typingsFile.contents)
|
||||
.toContain(
|
||||
'foo(x: number): number;\n static ngDirectiveDef: ɵngcc0.ɵDirectiveDefWithMeta');
|
||||
'foo(x: number): number;\n static ngDirectiveDef: ɵngcc0.ΔDirectiveDefWithMeta');
|
||||
});
|
||||
|
||||
it('should render imports into typings files', () => {
|
||||
|
@ -423,7 +423,7 @@ export class MetadataBundler {
|
||||
result[key] = this.convertFunction(moduleName, value);
|
||||
} else if (isMetadataSymbolicCallExpression(value)) {
|
||||
// Class members can also contain static members that call a function with module
|
||||
// references. e.g. "static ngInjectableDef = defineInjectable(..)". We also need to
|
||||
// references. e.g. "static ngInjectableDef = ΔdefineInjectable(..)". We also need to
|
||||
// convert these module references because otherwise these resolve to non-existent files.
|
||||
result[key] = this.convertValue(moduleName, value);
|
||||
} else {
|
||||
|
@ -48,15 +48,15 @@ export class NoopImportRewriter implements ImportRewriter {
|
||||
* which they're exported from r3_symbols.
|
||||
*/
|
||||
const CORE_SUPPORTED_SYMBOLS = new Map<string, string>([
|
||||
['defineInjectable', 'defineInjectable'],
|
||||
['defineInjector', 'defineInjector'],
|
||||
['ɵdefineNgModule', 'defineNgModule'],
|
||||
['ɵsetNgModuleScope', 'setNgModuleScope'],
|
||||
['inject', 'inject'],
|
||||
['ΔdefineInjectable', 'ΔdefineInjectable'],
|
||||
['ΔdefineInjector', 'ΔdefineInjector'],
|
||||
['ΔdefineNgModule', 'ΔdefineNgModule'],
|
||||
['ΔsetNgModuleScope', 'ΔsetNgModuleScope'],
|
||||
['Δinject', 'Δinject'],
|
||||
['ɵsetClassMetadata', 'setClassMetadata'],
|
||||
['ɵInjectableDef', 'InjectableDef'],
|
||||
['ɵInjectorDef', 'InjectorDef'],
|
||||
['ɵNgModuleDefWithMeta', 'NgModuleDefWithMeta'],
|
||||
['ΔInjectableDef', 'ΔInjectableDef'],
|
||||
['ΔInjectorDef', 'ΔInjectorDef'],
|
||||
['ΔNgModuleDefWithMeta', 'ΔNgModuleDefWithMeta'],
|
||||
['ɵNgModuleFactory', 'NgModuleFactory'],
|
||||
]);
|
||||
|
||||
|
@ -140,7 +140,7 @@ describe('mock_compiler', () => {
|
||||
expectEmit(
|
||||
result.source, `
|
||||
// TODO: this comment should not be taken into account
|
||||
$r3$.ɵtext(0, "Hello!");
|
||||
$r3$.Δtext(0, "Hello!");
|
||||
// TODO: this comment should not be taken into account
|
||||
`,
|
||||
'todo comments should be ignored');
|
||||
@ -214,4 +214,4 @@ describe('mock_compiler', () => {
|
||||
result.source, '$ctx$.$n$ … $ctx$.$n$.length', 'Match names', {'$n$': /(not)_(\1)/});
|
||||
}).toThrowError(/"\$n\$" is "name" which doesn't match \/\(not\)_\(\\1\)\//);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -39,13 +39,13 @@ describe('compiler compliance: bindings', () => {
|
||||
const template = `
|
||||
template:function MyComponent_Template(rf, $ctx$){
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelementStart(0, "div");
|
||||
$i0$.ɵtext(1);
|
||||
$i0$.ɵelementEnd();
|
||||
$i0$.ΔelementStart(0, "div");
|
||||
$i0$.Δtext(1);
|
||||
$i0$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵselect(1);
|
||||
$i0$.ɵtextBinding(1, $i0$.ɵinterpolation1("Hello ", $ctx$.name, ""));
|
||||
$r3$.Δselect(1);
|
||||
$i0$.ΔtextBinding(1, $i0$.Δinterpolation1("Hello ", $ctx$.name, ""));
|
||||
}
|
||||
}`;
|
||||
const result = compile(files, angularFiles);
|
||||
@ -78,11 +78,11 @@ describe('compiler compliance: bindings', () => {
|
||||
…
|
||||
template:function MyComponent_Template(rf, $ctx$){
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelement(0, "a", $e0_attrs$);
|
||||
$i0$.Δelement(0, "a", $e0_attrs$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$i0$.ɵselect(0);
|
||||
$i0$.ɵelementProperty(0, "title", $i0$.ɵbind($ctx$.title));
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "title", $i0$.Δbind($ctx$.title));
|
||||
}
|
||||
}`;
|
||||
const result = compile(files, angularFiles);
|
||||
@ -113,11 +113,11 @@ describe('compiler compliance: bindings', () => {
|
||||
…
|
||||
template:function MyComponent_Template(rf, $ctx$){
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelement(0, "a", $e0_attrs$);
|
||||
$i0$.Δelement(0, "a", $e0_attrs$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$i0$.ɵselect(0);
|
||||
$i0$.ɵelementProperty(0, "title", $i0$.ɵinterpolation1("Hello ", $ctx$.name, ""));
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "title", $i0$.Δinterpolation1("Hello ", $ctx$.name, ""));
|
||||
}
|
||||
}`;
|
||||
const result = compile(files, angularFiles);
|
||||
@ -138,7 +138,7 @@ describe('compiler compliance: bindings', () => {
|
||||
}
|
||||
};
|
||||
const result = compile(files, angularFiles);
|
||||
expect(result.source).not.toContain('i0.ɵelementProperty');
|
||||
expect(result.source).not.toContain('i0.ΔelementProperty');
|
||||
});
|
||||
|
||||
it('should not remap property names whose names do not correspond to their attribute names',
|
||||
@ -170,11 +170,11 @@ describe('compiler compliance: bindings', () => {
|
||||
|
||||
function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelement(0, "label", _c0);
|
||||
$i0$.Δelement(0, "label", _c0);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$i0$.ɵselect(0);
|
||||
$i0$.ɵelementProperty(0, "for", $i0$.ɵbind(ctx.forValue));
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "for", $i0$.Δbind(ctx.forValue));
|
||||
}
|
||||
}`;
|
||||
|
||||
@ -204,16 +204,16 @@ describe('compiler compliance: bindings', () => {
|
||||
};
|
||||
|
||||
const HostBindingDirDeclaration = `
|
||||
HostBindingDir.ngDirectiveDef = $r3$.ɵdefineDirective({
|
||||
HostBindingDir.ngDirectiveDef = $r3$.ΔdefineDirective({
|
||||
type: HostBindingDir,
|
||||
selectors: [["", "hostBindingDir", ""]],
|
||||
factory: function HostBindingDir_Factory(t) { return new (t || HostBindingDir)(); },
|
||||
hostBindings: function HostBindingDir_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵallocHostVars(1);
|
||||
$r3$.ΔallocHostVars(1);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementProperty(elIndex, "id", $r3$.ɵbind(ctx.dirId), null, true);
|
||||
$r3$.ΔelementProperty(elIndex, "id", $r3$.Δbind(ctx.dirId), null, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -251,16 +251,16 @@ describe('compiler compliance: bindings', () => {
|
||||
const HostBindingCompDeclaration = `
|
||||
const $ff$ = function ($v$) { return ["red", $v$]; };
|
||||
…
|
||||
HostBindingComp.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
HostBindingComp.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
type: HostBindingComp,
|
||||
selectors: [["host-binding-comp"]],
|
||||
factory: function HostBindingComp_Factory(t) { return new (t || HostBindingComp)(); },
|
||||
hostBindings: function HostBindingComp_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵallocHostVars(3);
|
||||
$r3$.ΔallocHostVars(3);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementProperty(elIndex, "id", $r3$.ɵbind($r3$.ɵpureFunction1(1, $ff$, ctx.id)), null, true);
|
||||
$r3$.ΔelementProperty(elIndex, "id", $r3$.Δbind($r3$.ΔpureFunction1(1, $ff$, ctx.id)), null, true);
|
||||
}
|
||||
},
|
||||
consts: 0,
|
||||
@ -299,16 +299,16 @@ describe('compiler compliance: bindings', () => {
|
||||
};
|
||||
|
||||
const HostAttributeDirDeclaration = `
|
||||
HostAttributeDir.ngDirectiveDef = $r3$.ɵdefineDirective({
|
||||
HostAttributeDir.ngDirectiveDef = $r3$.ΔdefineDirective({
|
||||
type: HostAttributeDir,
|
||||
selectors: [["", "hostAttributeDir", ""]],
|
||||
factory: function HostAttributeDir_Factory(t) { return new (t || HostAttributeDir)(); },
|
||||
hostBindings: function HostAttributeDir_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵallocHostVars(1);
|
||||
$r3$.ΔallocHostVars(1);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementAttribute(elIndex, "required", $r3$.ɵbind(ctx.required));
|
||||
$r3$.ΔelementAttribute(elIndex, "required", $r3$.Δbind(ctx.required));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -344,13 +344,13 @@ describe('compiler compliance: bindings', () => {
|
||||
const HostAttributeDirDeclaration = `
|
||||
const $c0$ = ["aria-label", "label"];
|
||||
…
|
||||
HostAttributeDir.ngDirectiveDef = $r3$.ɵdefineDirective({
|
||||
HostAttributeDir.ngDirectiveDef = $r3$.ΔdefineDirective({
|
||||
type: HostAttributeDir,
|
||||
selectors: [["", "hostAttributeDir", ""]],
|
||||
factory: function HostAttributeDir_Factory(t) { return new (t || HostAttributeDir)(); },
|
||||
hostBindings: function HostAttributeDir_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementHostAttrs($c0$);
|
||||
$r3$.ΔelementHostAttrs($c0$);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -402,25 +402,25 @@ describe('compiler compliance: bindings', () => {
|
||||
const $c0$ = ["title", "hello there from component", ${AttributeMarker.Styles}, "opacity", "1"];
|
||||
const $c1$ = ["title", "hello there from directive", ${AttributeMarker.Classes}, "one", "two", ${AttributeMarker.Styles}, "width", "200px", "height", "500px"];
|
||||
…
|
||||
HostAttributeComp.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
HostAttributeComp.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
type: HostAttributeComp,
|
||||
selectors: [["my-host-attribute-component"]],
|
||||
factory: function HostAttributeComp_Factory(t) { return new (t || HostAttributeComp)(); },
|
||||
hostBindings: function HostAttributeComp_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementHostAttrs($c0$);
|
||||
$r3$.ΔelementHostAttrs($c0$);
|
||||
…
|
||||
}
|
||||
…
|
||||
}
|
||||
…
|
||||
HostAttributeDir.ngDirectiveDef = $r3$.ɵdefineDirective({
|
||||
HostAttributeDir.ngDirectiveDef = $r3$.ΔdefineDirective({
|
||||
type: HostAttributeDir,
|
||||
selectors: [["", "hostAttributeDir", ""]],
|
||||
factory: function HostAttributeDir_Factory(t) { return new (t || HostAttributeDir)(); },
|
||||
hostBindings: function HostAttributeDir_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementHostAttrs($c1$);
|
||||
$r3$.ΔelementHostAttrs($c1$);
|
||||
…
|
||||
}
|
||||
…
|
||||
@ -466,19 +466,19 @@ describe('compiler compliance: bindings', () => {
|
||||
…
|
||||
template:function MyComponent_Template(rf, $ctx$){
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelementStart(0, "b", $_c0$, $_c1$);
|
||||
$i0$.ɵdisableBindings();
|
||||
$i0$.ɵelementStart(2, "i");
|
||||
$i0$.ɵtext(3, "Hello {{ name }}!");
|
||||
$i0$.ɵelementEnd();
|
||||
$i0$.ɵenableBindings();
|
||||
$i0$.ɵelementEnd();
|
||||
$i0$.ɵtext(4);
|
||||
$i0$.ΔelementStart(0, "b", $_c0$, $_c1$);
|
||||
$i0$.ΔdisableBindings();
|
||||
$i0$.ΔelementStart(2, "i");
|
||||
$i0$.Δtext(3, "Hello {{ name }}!");
|
||||
$i0$.ΔelementEnd();
|
||||
$i0$.ΔenableBindings();
|
||||
$i0$.ΔelementEnd();
|
||||
$i0$.Δtext(4);
|
||||
}
|
||||
if (rf & 2) {
|
||||
const $_r0$ = $i0$.ɵreference(1);
|
||||
$r3$.ɵselect(4);
|
||||
$i0$.ɵtextBinding(4, $i0$.ɵinterpolation1(" ", $_r0$.id, " "));
|
||||
const $_r0$ = $i0$.Δreference(1);
|
||||
$r3$.Δselect(4);
|
||||
$i0$.ΔtextBinding(4, $i0$.Δinterpolation1(" ", $_r0$.id, " "));
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -498,12 +498,12 @@ describe('compiler compliance: bindings', () => {
|
||||
…
|
||||
template:function MyComponent_Template(rf, $ctx$){
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelementStart(0, "div");
|
||||
$i0$.ɵdisableBindings();
|
||||
$i0$.ɵelement(1, "input", $_c0$);
|
||||
$i0$.ɵtext(2, " {{ myInput.value }} ");
|
||||
$i0$.ɵenableBindings();
|
||||
$i0$.ɵelementEnd();
|
||||
$i0$.ΔelementStart(0, "div");
|
||||
$i0$.ΔdisableBindings();
|
||||
$i0$.Δelement(1, "input", $_c0$);
|
||||
$i0$.Δtext(2, " {{ myInput.value }} ");
|
||||
$i0$.ΔenableBindings();
|
||||
$i0$.ΔelementEnd();
|
||||
}
|
||||
`;
|
||||
const result = compile(files, angularFiles);
|
||||
@ -522,11 +522,11 @@ describe('compiler compliance: bindings', () => {
|
||||
…
|
||||
template:function MyComponent_Template(rf, $ctx$){
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelementStart(0, "div");
|
||||
$i0$.ɵdisableBindings();
|
||||
$i0$.ɵelement(1, "div", $_c0$);
|
||||
$i0$.ɵenableBindings();
|
||||
$i0$.ɵelementEnd();
|
||||
$i0$.ΔelementStart(0, "div");
|
||||
$i0$.ΔdisableBindings();
|
||||
$i0$.Δelement(1, "div", $_c0$);
|
||||
$i0$.ΔenableBindings();
|
||||
$i0$.ΔelementEnd();
|
||||
}
|
||||
`;
|
||||
const result = compile(files, angularFiles);
|
||||
@ -541,7 +541,7 @@ describe('compiler compliance: bindings', () => {
|
||||
const template = `
|
||||
template:function MyComponent_Template(rf, $ctx$){
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelement(0, "div");
|
||||
$i0$.Δelement(0, "div");
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
@ -32,7 +32,7 @@ describe('compiler compliance: dependency injection', () => {
|
||||
export class MyComponent {
|
||||
constructor(
|
||||
@Attribute('name') name:string,
|
||||
s1: MyService,
|
||||
s1: MyService,
|
||||
@Host() s2: MyService,
|
||||
@Self() s4: MyService,
|
||||
@SkipSelf() s3: MyService,
|
||||
@ -50,13 +50,13 @@ describe('compiler compliance: dependency injection', () => {
|
||||
const factory = `
|
||||
factory: function MyComponent_Factory(t) {
|
||||
return new (t || MyComponent)(
|
||||
$r3$.ɵinjectAttribute('name'),
|
||||
$r3$.ɵdirectiveInject(MyService),
|
||||
$r3$.ɵdirectiveInject(MyService, 1),
|
||||
$r3$.ɵdirectiveInject(MyService, 2),
|
||||
$r3$.ɵdirectiveInject(MyService, 4),
|
||||
$r3$.ɵdirectiveInject(MyService, 8),
|
||||
$r3$.ɵdirectiveInject(MyService, 10)
|
||||
$r3$.ΔinjectAttribute('name'),
|
||||
$r3$.ΔdirectiveInject(MyService),
|
||||
$r3$.ΔdirectiveInject(MyService, 1),
|
||||
$r3$.ΔdirectiveInject(MyService, 2),
|
||||
$r3$.ΔdirectiveInject(MyService, 4),
|
||||
$r3$.ΔdirectiveInject(MyService, 8),
|
||||
$r3$.ΔdirectiveInject(MyService, 10)
|
||||
);
|
||||
}`;
|
||||
|
||||
|
@ -38,7 +38,7 @@ describe('compiler compliance: directives', () => {
|
||||
|
||||
// MyComponent definition should be:
|
||||
const MyComponentDefinition = `
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
type: MyComponent,
|
||||
selectors: [["my-component"]],
|
||||
factory: function MyComponent_Factory(t) { return new (t || MyComponent)(); },
|
||||
@ -46,7 +46,7 @@ describe('compiler compliance: directives', () => {
|
||||
vars: 0,
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelement(0, "div");
|
||||
$r3$.Δelement(0, "div");
|
||||
}
|
||||
},
|
||||
encapsulation: 2
|
||||
@ -84,7 +84,7 @@ describe('compiler compliance: directives', () => {
|
||||
|
||||
// MyComponent definition should be:
|
||||
const MyComponentDefinition = `
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
type: MyComponent,
|
||||
selectors: [["my-component"]],
|
||||
factory: function MyComponent_Factory(t) { return new (t || MyComponent)(); },
|
||||
@ -92,7 +92,7 @@ describe('compiler compliance: directives', () => {
|
||||
vars: 0,
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelement(0, "div");
|
||||
$r3$.Δelement(0, "div");
|
||||
}
|
||||
},
|
||||
encapsulation: 2
|
||||
@ -132,15 +132,15 @@ describe('compiler compliance: directives', () => {
|
||||
…
|
||||
const _c0 = [${AttributeMarker.Bindings}, "someDirective"];
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelement(0, "div", _c0);
|
||||
$r3$.Δelement(0, "div", _c0);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵselect(0);
|
||||
$r3$.ɵelementProperty(0, "someDirective", $r3$.ɵbind(true));
|
||||
$r3$.Δselect(0);
|
||||
$r3$.ΔelementProperty(0, "someDirective", $r3$.Δbind(true));
|
||||
}
|
||||
},
|
||||
…
|
||||
@ -187,15 +187,15 @@ describe('compiler compliance: directives', () => {
|
||||
const $_c0$ = ["directiveA", ""];
|
||||
function MyComponent_ng_template_0_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵtext(0, "Some content");
|
||||
$r3$.Δtext(0, "Some content");
|
||||
}
|
||||
}
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵtemplate(0, MyComponent_ng_template_0_Template, 1, 0, "ng-template", $_c0$);
|
||||
$r3$.Δtemplate(0, MyComponent_ng_template_0_Template, 1, 0, "ng-template", $_c0$);
|
||||
}
|
||||
},
|
||||
…
|
||||
@ -241,21 +241,21 @@ describe('compiler compliance: directives', () => {
|
||||
const $_c1$ = ["directiveA", ""];
|
||||
function MyComponent_ng_container_0_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementContainerStart(0, $_c1$);
|
||||
$r3$.ɵtext(1, "Some content");
|
||||
$r3$.ɵelementContainerEnd();
|
||||
$r3$.ΔelementContainerStart(0, $_c1$);
|
||||
$r3$.Δtext(1, "Some content");
|
||||
$r3$.ΔelementContainerEnd();
|
||||
}
|
||||
}
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵtemplate(0, MyComponent_ng_container_0_Template, 2, 0, "ng-container", $_c0$);
|
||||
$r3$.Δtemplate(0, MyComponent_ng_container_0_Template, 2, 0, "ng-container", $_c0$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵselect(0);
|
||||
$r3$.ɵelementProperty(0, "ngIf", $r3$.ɵbind(ctx.showing));
|
||||
$r3$.Δselect(0);
|
||||
$r3$.ΔelementProperty(0, "ngIf", $r3$.Δbind(ctx.showing));
|
||||
}
|
||||
},
|
||||
…
|
||||
@ -295,15 +295,15 @@ describe('compiler compliance: directives', () => {
|
||||
…
|
||||
const $c0_a0$ = [${AttributeMarker.Bindings}, "someDirective"];
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵtemplate(0, MyComponent_ng_template_0_Template, 0, 0, "ng-template", $c0_a0$);
|
||||
$r3$.Δtemplate(0, MyComponent_ng_template_0_Template, 0, 0, "ng-template", $c0_a0$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵselect(0);
|
||||
$r3$.ɵelementProperty(0, "someDirective", $r3$.ɵbind(true));
|
||||
$r3$.Δselect(0);
|
||||
$r3$.ΔelementProperty(0, "someDirective", $r3$.Δbind(true));
|
||||
}
|
||||
},
|
||||
…
|
||||
@ -344,11 +344,11 @@ describe('compiler compliance: directives', () => {
|
||||
…
|
||||
const $c0_a0$ = [${AttributeMarker.Template}, "someDirective"];
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵtemplate(0, MyComponent_div_0_Template, 1, 0, "div", $c0_a0$);
|
||||
$r3$.Δtemplate(0, MyComponent_div_0_Template, 1, 0, "div", $c0_a0$);
|
||||
}
|
||||
},
|
||||
…
|
||||
@ -393,13 +393,13 @@ describe('compiler compliance: directives', () => {
|
||||
…
|
||||
const $c0_a0$ = [${AttributeMarker.Bindings}, "someDirective"];
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div", $c0_a0$);
|
||||
$r3$.ɵlistener("someDirective", function MyComponent_Template_div_someDirective_0_listener($event) { return ctx.noop(); });
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementStart(0, "div", $c0_a0$);
|
||||
$r3$.Δlistener("someDirective", function MyComponent_Template_div_someDirective_0_listener($event) { return ctx.noop(); });
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
},
|
||||
…
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -52,7 +52,7 @@ describe('compiler compliance: listen()', () => {
|
||||
};
|
||||
|
||||
const componentDef = `
|
||||
MyComponent.ngComponentDef = IDENT.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = IDENT.ΔdefineComponent({
|
||||
…
|
||||
inputs:{
|
||||
componentInput: "componentInput",
|
||||
@ -66,7 +66,7 @@ describe('compiler compliance: listen()', () => {
|
||||
});`;
|
||||
|
||||
const directiveDef = `
|
||||
MyDirective.ngDirectiveDef = IDENT.ɵdefineDirective({
|
||||
MyDirective.ngDirectiveDef = IDENT.ΔdefineDirective({
|
||||
…
|
||||
inputs:{
|
||||
directiveInput: "directiveInput",
|
||||
|
@ -45,12 +45,12 @@ describe('compiler compliance: listen()', () => {
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div", $e0_attrs$);
|
||||
$r3$.ɵlistener("click", function MyComponent_Template_div_click_0_listener($event) {
|
||||
$r3$.ΔelementStart(0, "div", $e0_attrs$);
|
||||
$r3$.Δlistener("click", function MyComponent_Template_div_click_0_listener($event) {
|
||||
ctx.onClick($event);
|
||||
return (1 == 2);
|
||||
});
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -91,11 +91,11 @@ describe('compiler compliance: listen()', () => {
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "my-app", $e0_attrs$);
|
||||
$r3$.ɵlistener("click", function MyComponent_Template_my_app_click_0_listener($event) {
|
||||
$r3$.ΔelementStart(0, "my-app", $e0_attrs$);
|
||||
$r3$.Δlistener("click", function MyComponent_Template_my_app_click_0_listener($event) {
|
||||
return ctx.onClick($event);
|
||||
});
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -138,33 +138,33 @@ describe('compiler compliance: listen()', () => {
|
||||
|
||||
function MyComponent_div_0_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
const $s$ = $r3$.ɵgetCurrentView();
|
||||
$r3$.ɵelementStart(0, "div");
|
||||
$r3$.ɵelementStart(1, "div", $e_attrs$);
|
||||
$r3$.ɵlistener("click", function MyComponent_div_0_Template_div_click_1_listener($event) {
|
||||
$r3$.ɵrestoreView($s$);
|
||||
const $comp$ = $r3$.ɵnextContext();
|
||||
const $s$ = $r3$.ΔgetCurrentView();
|
||||
$r3$.ΔelementStart(0, "div");
|
||||
$r3$.ΔelementStart(1, "div", $e_attrs$);
|
||||
$r3$.Δlistener("click", function MyComponent_div_0_Template_div_click_1_listener($event) {
|
||||
$r3$.ΔrestoreView($s$);
|
||||
const $comp$ = $r3$.ΔnextContext();
|
||||
return $comp$.onClick($comp$.foo);
|
||||
});
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ɵelementStart(2, "button", $e_attrs$);
|
||||
$r3$.ɵlistener("click", function MyComponent_div_0_Template_button_click_2_listener($event) {
|
||||
$r3$.ɵrestoreView($s$);
|
||||
const $comp2$ = $r3$.ɵnextContext();
|
||||
$r3$.ΔelementEnd();
|
||||
$r3$.ΔelementStart(2, "button", $e_attrs$);
|
||||
$r3$.Δlistener("click", function MyComponent_div_0_Template_button_click_2_listener($event) {
|
||||
$r3$.ΔrestoreView($s$);
|
||||
const $comp2$ = $r3$.ΔnextContext();
|
||||
return $comp2$.onClick2($comp2$.bar);
|
||||
});
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementEnd();
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
}
|
||||
// ...
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵtemplate(0, MyComponent_div_0_Template, 3, 0, "div", $c0$);
|
||||
$r3$.Δtemplate(0, MyComponent_div_0_Template, 3, 0, "div", $c0$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$i0$.ɵselect(0);
|
||||
$i0$.ɵelementProperty(0, "ngIf", $i0$.ɵbind(ctx.showing));
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "ngIf", $i0$.Δbind(ctx.showing));
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -199,7 +199,7 @@ describe('compiler compliance: listen()', () => {
|
||||
const $e0_attrs$ = [${AttributeMarker.Bindings}, "click"];
|
||||
const $e2_refs$ = ["user", ""];
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
type: MyComponent,
|
||||
selectors: [["my-component"]],
|
||||
factory: function MyComponent_Factory(t) { return new (t || MyComponent)(); },
|
||||
@ -207,16 +207,16 @@ describe('compiler compliance: listen()', () => {
|
||||
vars: 0,
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
const $s$ = $r3$.ɵgetCurrentView();
|
||||
$r3$.ɵelementStart(0, "button", $e0_attrs$);
|
||||
$r3$.ɵlistener("click", function MyComponent_Template_button_click_0_listener($event) {
|
||||
$r3$.ɵrestoreView($s$);
|
||||
const $user$ = $r3$.ɵreference(3);
|
||||
const $s$ = $r3$.ΔgetCurrentView();
|
||||
$r3$.ΔelementStart(0, "button", $e0_attrs$);
|
||||
$r3$.Δlistener("click", function MyComponent_Template_button_click_0_listener($event) {
|
||||
$r3$.ΔrestoreView($s$);
|
||||
const $user$ = $r3$.Δreference(3);
|
||||
return ctx.onClick($user$.value);
|
||||
});
|
||||
$r3$.ɵtext(1, "Save");
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ɵelement(2, "input", null, $e2_refs$);
|
||||
$r3$.Δtext(1, "Save");
|
||||
$r3$.ΔelementEnd();
|
||||
$r3$.Δelement(2, "input", null, $e2_refs$);
|
||||
}
|
||||
},
|
||||
encapsulation: 2
|
||||
|
@ -46,7 +46,7 @@ describe('compiler compliance: providers', () => {
|
||||
const result = compile(files, angularFiles);
|
||||
expectEmit(
|
||||
result.source,
|
||||
'features: [i0.ɵProvidersFeature([GreeterEN, {provide: Greeter, useClass: GreeterEN}], [GreeterEN])],',
|
||||
'features: [i0.ΔProvidersFeature([GreeterEN, {provide: Greeter, useClass: GreeterEN}], [GreeterEN])],',
|
||||
'Incorrect features');
|
||||
});
|
||||
|
||||
@ -79,7 +79,7 @@ describe('compiler compliance: providers', () => {
|
||||
const result = compile(files, angularFiles);
|
||||
expectEmit(
|
||||
result.source,
|
||||
'features: [i0.ɵProvidersFeature([GreeterEN, {provide: Greeter, useClass: GreeterEN}])],',
|
||||
'features: [i0.ΔProvidersFeature([GreeterEN, {provide: Greeter, useClass: GreeterEN}])],',
|
||||
'Incorrect features');
|
||||
});
|
||||
|
||||
@ -111,7 +111,7 @@ describe('compiler compliance: providers', () => {
|
||||
|
||||
const result = compile(files, angularFiles);
|
||||
expectEmit(
|
||||
result.source, 'features: [i0.ɵProvidersFeature([], [GreeterEN])],', 'Incorrect features');
|
||||
result.source, 'features: [i0.ΔProvidersFeature([], [GreeterEN])],', 'Incorrect features');
|
||||
});
|
||||
|
||||
it('should not emit the ProvidersFeature feature when no providers', () => {
|
||||
|
@ -113,7 +113,7 @@ describe('r3_view_compiler', () => {
|
||||
};
|
||||
|
||||
const bV_call =
|
||||
`$r3$.ɵinterpolationV([" ",ctx.list[0]," ",ctx.list[1]," ",ctx.list[2]," ",ctx.list[3],
|
||||
`$r3$.ΔinterpolationV([" ",ctx.list[0]," ",ctx.list[1]," ",ctx.list[2]," ",ctx.list[3],
|
||||
" ",ctx.list[4]," ",ctx.list[5]," ",ctx.list[6]," ",ctx.list[7]," ",ctx.list[8],
|
||||
" "])`;
|
||||
const result = compile(files, angularFiles);
|
||||
@ -143,12 +143,12 @@ describe('r3_view_compiler', () => {
|
||||
const template = `
|
||||
template: function MyApp_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelement(0, "div");
|
||||
$i0$.Δelement(0, "div");
|
||||
}
|
||||
if (rf & 2) {
|
||||
$i0$.ɵselect(0);
|
||||
$i0$.ɵelementProperty(0, "@attr", …);
|
||||
$i0$.ɵelementProperty(0, "@binding", …);
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "@attr", …);
|
||||
$i0$.ΔelementProperty(0, "@binding", …);
|
||||
}
|
||||
}`;
|
||||
const result = compile(files, angularFiles);
|
||||
@ -176,10 +176,10 @@ describe('r3_view_compiler', () => {
|
||||
const template = `
|
||||
template: function MyApp_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelementStart(0, "div");
|
||||
$i0$.ΔelementStart(0, "div");
|
||||
…
|
||||
$i0$.ɵselect(0);
|
||||
$i0$.ɵelementProperty(0, "@mySelector", …);
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "@mySelector", …);
|
||||
}
|
||||
}`;
|
||||
const result = compile(files, angularFiles);
|
||||
|
@ -95,7 +95,7 @@ describe('compiler compliance: styling', () => {
|
||||
};
|
||||
|
||||
const template = `
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
…
|
||||
styles: ["div.cool { color: blue; }", ":host.nice p { color: gold; }"],
|
||||
encapsulation: 1
|
||||
@ -128,7 +128,7 @@ describe('compiler compliance: styling', () => {
|
||||
};
|
||||
|
||||
const template = `
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
type: MyComponent,
|
||||
selectors:[["my-component"]],
|
||||
factory:function MyComponent_Factory(t){
|
||||
@ -170,7 +170,7 @@ describe('compiler compliance: styling', () => {
|
||||
};
|
||||
|
||||
const template = `
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
type: MyComponent,
|
||||
selectors:[["my-component"]],
|
||||
factory:function MyComponent_Factory(t){
|
||||
@ -215,23 +215,23 @@ describe('compiler compliance: styling', () => {
|
||||
|
||||
const template = `
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
…
|
||||
consts: 3,
|
||||
vars: 3,
|
||||
template: function MyComponent_Template(rf, $ctx$) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelement(0, "div");
|
||||
$r3$.ɵelement(1, "div");
|
||||
$r3$.ɵelement(2, "div");
|
||||
$r3$.Δelement(0, "div");
|
||||
$r3$.Δelement(1, "div");
|
||||
$r3$.Δelement(2, "div");
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵselect(0);
|
||||
$r3$.ɵelementProperty(0, "@foo", $r3$.ɵbind(ctx.exp));
|
||||
$r3$.ɵselect(1);
|
||||
$r3$.ɵelementProperty(1, "@bar", $r3$.ɵbind(undefined));
|
||||
$r3$.ɵselect(2);
|
||||
$r3$.ɵelementProperty(2, "@baz", $r3$.ɵbind(undefined));
|
||||
$r3$.Δselect(0);
|
||||
$r3$.ΔelementProperty(0, "@foo", $r3$.Δbind(ctx.exp));
|
||||
$r3$.Δselect(1);
|
||||
$r3$.ΔelementProperty(1, "@bar", $r3$.Δbind(undefined));
|
||||
$r3$.Δselect(2);
|
||||
$r3$.ΔelementProperty(2, "@baz", $r3$.Δbind(undefined));
|
||||
}
|
||||
},
|
||||
encapsulation: 2
|
||||
@ -277,19 +277,19 @@ describe('compiler compliance: styling', () => {
|
||||
|
||||
const template = `
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
…
|
||||
consts: 1,
|
||||
vars: 1,
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div");
|
||||
$r3$.ɵlistener("@myAnimation.start", function MyComponent_Template_div_animation_myAnimation_start_0_listener($event) { return ctx.onStart($event); });
|
||||
$r3$.ɵlistener("@myAnimation.done", function MyComponent_Template_div_animation_myAnimation_done_0_listener($event) { return ctx.onDone($event); });
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementStart(0, "div");
|
||||
$r3$.Δlistener("@myAnimation.start", function MyComponent_Template_div_animation_myAnimation_start_0_listener($event) { return ctx.onStart($event); });
|
||||
$r3$.Δlistener("@myAnimation.done", function MyComponent_Template_div_animation_myAnimation_done_0_listener($event) { return ctx.onDone($event); });
|
||||
$r3$.ΔelementEnd();
|
||||
} if (rf & 2) {
|
||||
$r3$.ɵselect(0);
|
||||
$r3$.ɵelementProperty(0, "@myAnimation", $r3$.ɵbind(ctx.exp));
|
||||
$r3$.Δselect(0);
|
||||
$r3$.ΔelementProperty(0, "@myAnimation", $r3$.Δbind(ctx.exp));
|
||||
}
|
||||
},
|
||||
encapsulation: 2,
|
||||
@ -340,15 +340,15 @@ describe('compiler compliance: styling', () => {
|
||||
};
|
||||
|
||||
const template = `
|
||||
MyAnimDir.ngDirectiveDef = $r3$.ɵdefineDirective({
|
||||
MyAnimDir.ngDirectiveDef = $r3$.ΔdefineDirective({
|
||||
…
|
||||
hostBindings: function MyAnimDir_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵallocHostVars(1);
|
||||
$r3$.ɵcomponentHostSyntheticListener("@myAnim.start", function MyAnimDir_animation_myAnim_start_HostBindingHandler($event) { return ctx.onStart(); });
|
||||
$r3$.ɵcomponentHostSyntheticListener("@myAnim.done", function MyAnimDir_animation_myAnim_done_HostBindingHandler($event) { return ctx.onDone(); });
|
||||
$r3$.ΔallocHostVars(1);
|
||||
$r3$.ΔcomponentHostSyntheticListener("@myAnim.start", function MyAnimDir_animation_myAnim_start_HostBindingHandler($event) { return ctx.onStart(); });
|
||||
$r3$.ΔcomponentHostSyntheticListener("@myAnim.done", function MyAnimDir_animation_myAnim_done_HostBindingHandler($event) { return ctx.onDone(); });
|
||||
} if (rf & 2) {
|
||||
$r3$.ɵcomponentHostSyntheticProperty(elIndex, "@myAnim", $r3$.ɵbind(ctx.myAnimState), null, true);
|
||||
$r3$.ΔcomponentHostSyntheticProperty(elIndex, "@myAnim", $r3$.Δbind(ctx.myAnimState), null, true);
|
||||
}
|
||||
}
|
||||
…
|
||||
@ -384,13 +384,13 @@ describe('compiler compliance: styling', () => {
|
||||
const template = `
|
||||
template: function MyComponent_Template(rf, $ctx$) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div");
|
||||
$r3$.ɵelementStyling(null, null, $r3$.ɵdefaultStyleSanitizer);
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementStart(0, "div");
|
||||
$r3$.ΔelementStyling(null, null, $r3$.ΔdefaultStyleSanitizer);
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementStylingMap(0, null, $ctx$.myStyleExp);
|
||||
$r3$.ɵelementStylingApply(0);
|
||||
$r3$.ΔelementStylingMap(0, null, $ctx$.myStyleExp);
|
||||
$r3$.ΔelementStylingApply(0);
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -449,13 +449,13 @@ describe('compiler compliance: styling', () => {
|
||||
vars: 1,
|
||||
template: function MyComponentWithInterpolation_Template(rf, $ctx$) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div");
|
||||
$r3$.ɵelementStyling();
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementStart(0, "div");
|
||||
$r3$.ΔelementStyling();
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementStylingMap(0, $r3$.ɵinterpolation1("foo foo-", $ctx$.fooId, ""));
|
||||
$r3$.ɵelementStylingApply(0);
|
||||
$r3$.ΔelementStylingMap(0, $r3$.Δinterpolation1("foo foo-", $ctx$.fooId, ""));
|
||||
$r3$.ΔelementStylingApply(0);
|
||||
}
|
||||
}
|
||||
…
|
||||
@ -463,13 +463,13 @@ describe('compiler compliance: styling', () => {
|
||||
vars: 2,
|
||||
template: function MyComponentWithMuchosInterpolation_Template(rf, $ctx$) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div");
|
||||
$r3$.ɵelementStyling();
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementStart(0, "div");
|
||||
$r3$.ΔelementStyling();
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementStylingMap(0, $r3$.ɵinterpolation2("foo foo-", $ctx$.fooId, "-", $ctx$.fooUsername, ""));
|
||||
$r3$.ɵelementStylingApply(0);
|
||||
$r3$.ΔelementStylingMap(0, $r3$.Δinterpolation2("foo foo-", $ctx$.fooId, "-", $ctx$.fooUsername, ""));
|
||||
$r3$.ΔelementStylingApply(0);
|
||||
}
|
||||
}
|
||||
…
|
||||
@ -477,13 +477,13 @@ describe('compiler compliance: styling', () => {
|
||||
vars: 0,
|
||||
template: function MyComponentWithoutInterpolation_Template(rf, $ctx$) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div");
|
||||
$r3$.ɵelementStyling();
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementStart(0, "div");
|
||||
$r3$.ΔelementStyling();
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementStylingMap(0, $ctx$.exp);
|
||||
$r3$.ɵelementStylingApply(0);
|
||||
$r3$.ΔelementStylingMap(0, $ctx$.exp);
|
||||
$r3$.ΔelementStylingApply(0);
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -523,7 +523,7 @@ describe('compiler compliance: styling', () => {
|
||||
const $_c0$ = [${AttributeMarker.Styles}, "opacity", "1", ${AttributeMarker.Bindings}, "style"];
|
||||
const $_c1$ = ["width", "height"];
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
type: MyComponent,
|
||||
selectors:[["my-component"]],
|
||||
factory:function MyComponent_Factory(t){
|
||||
@ -533,17 +533,17 @@ describe('compiler compliance: styling', () => {
|
||||
vars: 1,
|
||||
template: function MyComponent_Template(rf, $ctx$) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div", $_c0$);
|
||||
$r3$.ɵelementStyling(null, $_c1$, $r3$.ɵdefaultStyleSanitizer);
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementStart(0, "div", $_c0$);
|
||||
$r3$.ΔelementStyling(null, $_c1$, $r3$.ΔdefaultStyleSanitizer);
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementStylingMap(0, null, $ctx$.myStyleExp);
|
||||
$r3$.ɵelementStyleProp(0, 0, $ctx$.myWidth);
|
||||
$r3$.ɵelementStyleProp(0, 1, $ctx$.myHeight);
|
||||
$r3$.ɵelementStylingApply(0);
|
||||
$r3$.ɵselect(0);
|
||||
$r3$.ɵelementAttribute(0, "style", $r3$.ɵbind("border-width: 10px"), $r3$.ɵsanitizeStyle);
|
||||
$r3$.ΔelementStylingMap(0, null, $ctx$.myStyleExp);
|
||||
$r3$.ΔelementStyleProp(0, 0, $ctx$.myWidth);
|
||||
$r3$.ΔelementStyleProp(0, 1, $ctx$.myHeight);
|
||||
$r3$.ΔelementStylingApply(0);
|
||||
$r3$.Δselect(0);
|
||||
$r3$.ΔelementAttribute(0, "style", $r3$.Δbind("border-width: 10px"), $r3$.ΔsanitizeStyle);
|
||||
}
|
||||
},
|
||||
encapsulation: 2
|
||||
@ -583,7 +583,7 @@ describe('compiler compliance: styling', () => {
|
||||
}
|
||||
}
|
||||
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
type: MyComponent,
|
||||
selectors: [["my-component"]],
|
||||
factory: function MyComponent_Factory(t) {
|
||||
@ -593,13 +593,13 @@ describe('compiler compliance: styling', () => {
|
||||
vars: 0,
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div");
|
||||
$r3$.ɵelementStyling(null, _c0, $r3$.ɵdefaultStyleSanitizer);
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementStart(0, "div");
|
||||
$r3$.ΔelementStyling(null, _c0, $r3$.ΔdefaultStyleSanitizer);
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementStyleProp(0, 0, ctx.myImage);
|
||||
$r3$.ɵelementStylingApply(0);
|
||||
$r3$.ΔelementStyleProp(0, 0, ctx.myImage);
|
||||
$r3$.ΔelementStylingApply(0);
|
||||
}
|
||||
},
|
||||
encapsulation: 2
|
||||
@ -634,13 +634,13 @@ describe('compiler compliance: styling', () => {
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div");
|
||||
$r3$.ɵelementStyling(null, _c0);
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementStart(0, "div");
|
||||
$r3$.ΔelementStyling(null, _c0);
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementStyleProp(0, 0, 12, "px");
|
||||
$r3$.ɵelementStylingApply(0);
|
||||
$r3$.ΔelementStyleProp(0, 0, 12, "px");
|
||||
$r3$.ΔelementStylingApply(0);
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -675,13 +675,13 @@ describe('compiler compliance: styling', () => {
|
||||
const template = `
|
||||
template: function MyComponent_Template(rf, $ctx$) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div");
|
||||
$r3$.ɵelementStyling();
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementStart(0, "div");
|
||||
$r3$.ΔelementStyling();
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementStylingMap(0,$ctx$.myClassExp);
|
||||
$r3$.ɵelementStylingApply(0);
|
||||
$r3$.ΔelementStylingMap(0,$ctx$.myClassExp);
|
||||
$r3$.ΔelementStylingApply(0);
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -721,7 +721,7 @@ describe('compiler compliance: styling', () => {
|
||||
const $e0_attrs$ = [${AttributeMarker.Classes}, "grape", ${AttributeMarker.Bindings}, "class"];
|
||||
const $e0_bindings$ = ["apple", "orange"];
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
type: MyComponent,
|
||||
selectors:[["my-component"]],
|
||||
factory:function MyComponent_Factory(t){
|
||||
@ -731,17 +731,17 @@ describe('compiler compliance: styling', () => {
|
||||
vars: 1,
|
||||
template: function MyComponent_Template(rf, $ctx$) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div", $e0_attrs$);
|
||||
$r3$.ɵelementStyling($e0_bindings$);
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementStart(0, "div", $e0_attrs$);
|
||||
$r3$.ΔelementStyling($e0_bindings$);
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementStylingMap(0, $ctx$.myClassExp);
|
||||
$r3$.ɵelementClassProp(0, 0, $ctx$.yesToApple);
|
||||
$r3$.ɵelementClassProp(0, 1, $ctx$.yesToOrange);
|
||||
$r3$.ɵelementStylingApply(0);
|
||||
$r3$.ɵselect(0);
|
||||
$r3$.ɵelementAttribute(0, "class", $r3$.ɵbind("banana"));
|
||||
$r3$.ΔelementStylingMap(0, $ctx$.myClassExp);
|
||||
$r3$.ΔelementClassProp(0, 0, $ctx$.yesToApple);
|
||||
$r3$.ΔelementClassProp(0, 1, $ctx$.yesToOrange);
|
||||
$r3$.ΔelementStylingApply(0);
|
||||
$r3$.Δselect(0);
|
||||
$r3$.ΔelementAttribute(0, "class", $r3$.Δbind("banana"));
|
||||
}
|
||||
},
|
||||
encapsulation: 2
|
||||
@ -777,7 +777,7 @@ describe('compiler compliance: styling', () => {
|
||||
const template = `
|
||||
const $e0_attrs$ = [${AttributeMarker.Classes}, "foo", ${AttributeMarker.Styles}, "width", "100px", ${AttributeMarker.Bindings}, "class", "style"];
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ɵdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
type: MyComponent,
|
||||
selectors:[["my-component"]],
|
||||
factory:function MyComponent_Factory(t){
|
||||
@ -787,12 +787,12 @@ describe('compiler compliance: styling', () => {
|
||||
vars: 2,
|
||||
template: function MyComponent_Template(rf, $ctx$) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelement(0, "div", $e0_attrs$);
|
||||
$r3$.Δelement(0, "div", $e0_attrs$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵselect(0);
|
||||
$r3$.ɵelementAttribute(0, "class", $r3$.ɵbind("round"));
|
||||
$r3$.ɵelementAttribute(0, "style", $r3$.ɵbind("height:100px"), $r3$.ɵsanitizeStyle);
|
||||
$r3$.Δselect(0);
|
||||
$r3$.ΔelementAttribute(0, "class", $r3$.Δbind("round"));
|
||||
$r3$.ΔelementAttribute(0, "style", $r3$.Δbind("height:100px"), $r3$.ΔsanitizeStyle);
|
||||
}
|
||||
},
|
||||
encapsulation: 2
|
||||
@ -829,13 +829,13 @@ describe('compiler compliance: styling', () => {
|
||||
const template = `
|
||||
template: function MyComponent_Template(rf, $ctx$) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div");
|
||||
$r3$.ɵelementStyling(null, null, $r3$.ɵdefaultStyleSanitizer);
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementStart(0, "div");
|
||||
$r3$.ΔelementStyling(null, null, $r3$.ΔdefaultStyleSanitizer);
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementStylingMap(0, $ctx$.myClassExp, $ctx$.myStyleExp);
|
||||
$r3$.ɵelementStylingApply(0);
|
||||
$r3$.ΔelementStylingMap(0, $ctx$.myClassExp, $ctx$.myStyleExp);
|
||||
$r3$.ΔelementStylingApply(0);
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -869,15 +869,15 @@ describe('compiler compliance: styling', () => {
|
||||
const template = `
|
||||
template: function MyComponent_Template(rf, $ctx$) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div");
|
||||
$r3$.ɵelementStyling(null, null, $r3$.ɵdefaultStyleSanitizer);
|
||||
$r3$.ɵpipe(1, "classPipe");
|
||||
$r3$.ɵpipe(2, "stylePipe");
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementStart(0, "div");
|
||||
$r3$.ΔelementStyling(null, null, $r3$.ΔdefaultStyleSanitizer);
|
||||
$r3$.Δpipe(1, "classPipe");
|
||||
$r3$.Δpipe(2, "stylePipe");
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementStylingMap(0, $r3$.ɵpipeBind1(1, 0, $ctx$.myClassExp), $r3$.ɵpipeBind1(2, 2, $ctx$.myStyleExp));
|
||||
$r3$.ɵelementStylingApply(0);
|
||||
$r3$.ΔelementStylingMap(0, $r3$.ΔpipeBind1(1, 0, $ctx$.myClassExp), $r3$.ΔpipeBind1(2, 2, $ctx$.myStyleExp));
|
||||
$r3$.ΔelementStylingApply(0);
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -922,23 +922,23 @@ describe('compiler compliance: styling', () => {
|
||||
…
|
||||
template: function MyComponent_Template(rf, $ctx$) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div");
|
||||
$r3$.ɵelementStyling($e0_classBindings$, $e0_styleBindings$, $r3$.ɵdefaultStyleSanitizer);
|
||||
$r3$.ɵpipe(1, "pipe");
|
||||
$r3$.ɵpipe(2, "pipe");
|
||||
$r3$.ɵpipe(3, "pipe");
|
||||
$r3$.ɵpipe(4, "pipe");
|
||||
$r3$.ɵtext(5);
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementStart(0, "div");
|
||||
$r3$.ΔelementStyling($e0_classBindings$, $e0_styleBindings$, $r3$.ΔdefaultStyleSanitizer);
|
||||
$r3$.Δpipe(1, "pipe");
|
||||
$r3$.Δpipe(2, "pipe");
|
||||
$r3$.Δpipe(3, "pipe");
|
||||
$r3$.Δpipe(4, "pipe");
|
||||
$r3$.Δtext(5);
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementStylingMap(0, $e2_styling$, $r3$.ɵpipeBind2(1, 1, $ctx$.myStyleExp, 1000));
|
||||
$r3$.ɵelementStyleProp(0, 0, $r3$.ɵpipeBind2(2, 4, $ctx$.barExp, 3000));
|
||||
$r3$.ɵelementStyleProp(0, 1, $r3$.ɵpipeBind2(3, 7, $ctx$.bazExp, 4000));
|
||||
$r3$.ɵelementClassProp(0, 0, $r3$.ɵpipeBind2(4, 10, $ctx$.fooExp, 2000));
|
||||
$r3$.ɵelementStylingApply(0);
|
||||
$r3$.ɵselect(5);
|
||||
$r3$.ɵtextBinding(5, $r3$.ɵinterpolation1(" ", $ctx$.item, ""));
|
||||
$r3$.ΔelementStylingMap(0, $e2_styling$, $r3$.ΔpipeBind2(1, 1, $ctx$.myStyleExp, 1000));
|
||||
$r3$.ΔelementStyleProp(0, 0, $r3$.ΔpipeBind2(2, 4, $ctx$.barExp, 3000));
|
||||
$r3$.ΔelementStyleProp(0, 1, $r3$.ΔpipeBind2(3, 7, $ctx$.bazExp, 4000));
|
||||
$r3$.ΔelementClassProp(0, 0, $r3$.ΔpipeBind2(4, 10, $ctx$.fooExp, 2000));
|
||||
$r3$.ΔelementStylingApply(0);
|
||||
$r3$.Δselect(5);
|
||||
$r3$.ΔtextBinding(5, $r3$.Δinterpolation1(" ", $ctx$.item, ""));
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -990,14 +990,14 @@ describe('compiler compliance: styling', () => {
|
||||
…
|
||||
hostBindings: function MyComponent_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementHostAttrs($e0_attrs$);
|
||||
$r3$.ɵelementHostStyling($e0_classBindings$, $e0_styleBindings$, $r3$.ɵdefaultStyleSanitizer);
|
||||
$r3$.ΔelementHostAttrs($e0_attrs$);
|
||||
$r3$.ΔelementHostStyling($e0_classBindings$, $e0_styleBindings$, $r3$.ΔdefaultStyleSanitizer);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementHostStylingMap(ctx.myClass, ctx.myStyle);
|
||||
$r3$.ɵelementHostStyleProp(0, ctx.myColorProp);
|
||||
$r3$.ɵelementHostClassProp(0, ctx.myFooClass);
|
||||
$r3$.ɵelementHostStylingApply();
|
||||
$r3$.ΔelementHostStylingMap(ctx.myClass, ctx.myStyle);
|
||||
$r3$.ΔelementHostStyleProp(0, ctx.myColorProp);
|
||||
$r3$.ΔelementHostClassProp(0, ctx.myFooClass);
|
||||
$r3$.ΔelementHostStylingApply();
|
||||
}
|
||||
},
|
||||
consts: 0,
|
||||
@ -1051,15 +1051,15 @@ describe('compiler compliance: styling', () => {
|
||||
…
|
||||
hostBindings: function MyComponent_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementHostStyling(_c0, _c1, $r3$.ɵdefaultStyleSanitizer);
|
||||
$r3$.ΔelementHostStyling(_c0, _c1, $r3$.ΔdefaultStyleSanitizer);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementHostStylingMap(ctx.myClasses, ctx.myStyle);
|
||||
$r3$.ɵelementHostStyleProp(0, ctx.myHeightProp, "pt");
|
||||
$r3$.ɵelementHostStyleProp(1, ctx.myWidthProp);
|
||||
$r3$.ɵelementHostClassProp(0, ctx.myBarClass);
|
||||
$r3$.ɵelementHostClassProp(1, ctx.myFooClass);
|
||||
$r3$.ɵelementHostStylingApply();
|
||||
$r3$.ΔelementHostStylingMap(ctx.myClasses, ctx.myStyle);
|
||||
$r3$.ΔelementHostStyleProp(0, ctx.myHeightProp, "pt");
|
||||
$r3$.ΔelementHostStyleProp(1, ctx.myWidthProp);
|
||||
$r3$.ΔelementHostClassProp(0, ctx.myBarClass);
|
||||
$r3$.ΔelementHostClassProp(1, ctx.myFooClass);
|
||||
$r3$.ΔelementHostStylingApply();
|
||||
}
|
||||
},
|
||||
consts: 0,
|
||||
@ -1113,15 +1113,15 @@ describe('compiler compliance: styling', () => {
|
||||
…
|
||||
function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementStart(0, "div");
|
||||
$r3$.ɵelementStyling(_c2, _c3, $r3$.ɵdefaultStyleSanitizer);
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementStart(0, "div");
|
||||
$r3$.ΔelementStyling(_c2, _c3, $r3$.ΔdefaultStyleSanitizer);
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementStylingMap(0, ctx.myClassExp, ctx.myStyleExp);
|
||||
$r3$.ɵelementStyleProp(0, 0, ctx.myHeightExp, null, true);
|
||||
$r3$.ɵelementClassProp(0, 0, ctx.myBarClassExp, true);
|
||||
$r3$.ɵelementStylingApply(0);
|
||||
$r3$.ΔelementStylingMap(0, ctx.myClassExp, ctx.myStyleExp);
|
||||
$r3$.ΔelementStyleProp(0, 0, ctx.myHeightExp, null, true);
|
||||
$r3$.ΔelementClassProp(0, 0, ctx.myBarClassExp, true);
|
||||
$r3$.ΔelementStylingApply(0);
|
||||
}
|
||||
},
|
||||
`;
|
||||
@ -1132,13 +1132,13 @@ describe('compiler compliance: styling', () => {
|
||||
…
|
||||
hostBindings: function MyComponent_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementHostStyling(_c0, _c1, $r3$.ɵdefaultStyleSanitizer);
|
||||
$r3$.ΔelementHostStyling(_c0, _c1, $r3$.ΔdefaultStyleSanitizer);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementHostStylingMap(ctx.myClassExp, ctx.myStyleExp);
|
||||
$r3$.ɵelementHostStyleProp(0, ctx.myWidthExp, null, true);
|
||||
$r3$.ɵelementHostClassProp(0, ctx.myFooClassExp, true);
|
||||
$r3$.ɵelementHostStylingApply();
|
||||
$r3$.ΔelementHostStylingMap(ctx.myClassExp, ctx.myStyleExp);
|
||||
$r3$.ΔelementHostStyleProp(0, ctx.myWidthExp, null, true);
|
||||
$r3$.ΔelementHostClassProp(0, ctx.myFooClassExp, true);
|
||||
$r3$.ΔelementHostStylingApply();
|
||||
}
|
||||
},
|
||||
`;
|
||||
@ -1200,33 +1200,33 @@ describe('compiler compliance: styling', () => {
|
||||
…
|
||||
function ClassDirective_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementHostStyling();
|
||||
$r3$.ΔelementHostStyling();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementHostStylingMap(ctx.myClassMap);
|
||||
$r3$.ɵelementHostStylingApply();
|
||||
$r3$.ΔelementHostStylingMap(ctx.myClassMap);
|
||||
$r3$.ΔelementHostStylingApply();
|
||||
}
|
||||
}
|
||||
…
|
||||
function WidthDirective_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementHostStyling($widthDir_classes$, $widthDir_styles$);
|
||||
$r3$.ΔelementHostStyling($widthDir_classes$, $widthDir_styles$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementHostStyleProp(0, ctx.myWidth);
|
||||
$r3$.ɵelementHostClassProp(0, ctx.myFooClass);
|
||||
$r3$.ɵelementHostStylingApply();
|
||||
$r3$.ΔelementHostStyleProp(0, ctx.myWidth);
|
||||
$r3$.ΔelementHostClassProp(0, ctx.myFooClass);
|
||||
$r3$.ΔelementHostStylingApply();
|
||||
}
|
||||
}
|
||||
…
|
||||
function HeightDirective_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵelementHostStyling($heightDir_classes$, $heightDir_styles$);
|
||||
$r3$.ΔelementHostStyling($heightDir_classes$, $heightDir_styles$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementHostStyleProp(0, ctx.myHeight);
|
||||
$r3$.ɵelementHostClassProp(0, ctx.myBarClass);
|
||||
$r3$.ɵelementHostStylingApply();
|
||||
$r3$.ΔelementHostStyleProp(0, ctx.myHeight);
|
||||
$r3$.ΔelementHostClassProp(0, ctx.myBarClass);
|
||||
$r3$.ΔelementHostStylingApply();
|
||||
}
|
||||
}
|
||||
…
|
||||
@ -1280,15 +1280,15 @@ describe('compiler compliance: styling', () => {
|
||||
…
|
||||
hostBindings: function MyComponent_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵallocHostVars(2);
|
||||
$r3$.ɵelementHostAttrs($_c0$);
|
||||
$r3$.ɵelementHostStyling(null, null, $r3$.ɵdefaultStyleSanitizer);
|
||||
$r3$.ΔallocHostVars(2);
|
||||
$r3$.ΔelementHostAttrs($_c0$);
|
||||
$r3$.ΔelementHostStyling(null, null, $r3$.ΔdefaultStyleSanitizer);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementProperty(elIndex, "id", $r3$.ɵbind(ctx.id), null, true);
|
||||
$r3$.ɵelementProperty(elIndex, "title", $r3$.ɵbind(ctx.title), null, true);
|
||||
$r3$.ɵelementHostStylingMap(ctx.myClass, ctx.myStyle);
|
||||
$r3$.ɵelementHostStylingApply();
|
||||
$r3$.ΔelementProperty(elIndex, "id", $r3$.Δbind(ctx.id), null, true);
|
||||
$r3$.ΔelementProperty(elIndex, "title", $r3$.Δbind(ctx.title), null, true);
|
||||
$r3$.ΔelementHostStylingMap(ctx.myClass, ctx.myStyle);
|
||||
$r3$.ΔelementHostStylingApply();
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -1327,15 +1327,15 @@ describe('compiler compliance: styling', () => {
|
||||
…
|
||||
hostBindings: function WidthDirective_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵallocHostVars(2);
|
||||
$r3$.ɵelementHostStyling($_c0$, $_c1$);
|
||||
$r3$.ΔallocHostVars(2);
|
||||
$r3$.ΔelementHostStyling($_c0$, $_c1$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵelementProperty(elIndex, "id", $r3$.ɵbind(ctx.id), null, true);
|
||||
$r3$.ɵelementProperty(elIndex, "title", $r3$.ɵbind(ctx.title), null, true);
|
||||
$r3$.ɵelementHostStyleProp(0, ctx.myWidth);
|
||||
$r3$.ɵelementHostClassProp(0, ctx.myFooClass);
|
||||
$r3$.ɵelementHostStylingApply();
|
||||
$r3$.ΔelementProperty(elIndex, "id", $r3$.Δbind(ctx.id), null, true);
|
||||
$r3$.ΔelementProperty(elIndex, "title", $r3$.Δbind(ctx.title), null, true);
|
||||
$r3$.ΔelementHostStyleProp(0, ctx.myWidth);
|
||||
$r3$.ΔelementHostClassProp(0, ctx.myFooClass);
|
||||
$r3$.ΔelementHostStylingApply();
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
@ -56,65 +56,65 @@ describe('compiler compliance: template', () => {
|
||||
function MyComponent_ul_0_li_1_div_1_Template(rf, ctx) {
|
||||
|
||||
if (rf & 1) {
|
||||
const $s$ = $i0$.ɵgetCurrentView();
|
||||
$i0$.ɵelementStart(0, "div", $c2$);
|
||||
$i0$.ɵlistener("click", function MyComponent_ul_0_li_1_div_1_Template_div_click_0_listener($event){
|
||||
$i0$.ɵrestoreView($s$);
|
||||
const $s$ = $i0$.ΔgetCurrentView();
|
||||
$i0$.ΔelementStart(0, "div", $c2$);
|
||||
$i0$.Δlistener("click", function MyComponent_ul_0_li_1_div_1_Template_div_click_0_listener($event){
|
||||
$i0$.ΔrestoreView($s$);
|
||||
const $inner$ = ctx.$implicit;
|
||||
const $middle$ = $i0$.ɵnextContext().$implicit;
|
||||
const $outer$ = $i0$.ɵnextContext().$implicit;
|
||||
const $myComp$ = $i0$.ɵnextContext();
|
||||
const $middle$ = $i0$.ΔnextContext().$implicit;
|
||||
const $outer$ = $i0$.ΔnextContext().$implicit;
|
||||
const $myComp$ = $i0$.ΔnextContext();
|
||||
return $myComp$.onClick($outer$, $middle$, $inner$);
|
||||
});
|
||||
$i0$.ɵtext(1);
|
||||
$i0$.ɵelementEnd();
|
||||
$i0$.Δtext(1);
|
||||
$i0$.ΔelementEnd();
|
||||
}
|
||||
|
||||
if (rf & 2) {
|
||||
const $inner1$ = ctx.$implicit;
|
||||
const $middle1$ = $i0$.ɵnextContext().$implicit;
|
||||
const $outer1$ = $i0$.ɵnextContext().$implicit;
|
||||
const $myComp1$ = $i0$.ɵnextContext();
|
||||
$i0$.ɵselect(0);
|
||||
$i0$.ɵelementProperty(0, "title", $i0$.ɵbind($myComp1$.format($outer1$, $middle1$, $inner1$, $myComp1$.component)));
|
||||
$r3$.ɵselect(1);
|
||||
$i0$.ɵtextBinding(1, $i0$.ɵinterpolation1(" ", $myComp1$.format($outer1$, $middle1$, $inner1$, $myComp1$.component), " "));
|
||||
const $middle1$ = $i0$.ΔnextContext().$implicit;
|
||||
const $outer1$ = $i0$.ΔnextContext().$implicit;
|
||||
const $myComp1$ = $i0$.ΔnextContext();
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "title", $i0$.Δbind($myComp1$.format($outer1$, $middle1$, $inner1$, $myComp1$.component)));
|
||||
$r3$.Δselect(1);
|
||||
$i0$.ΔtextBinding(1, $i0$.Δinterpolation1(" ", $myComp1$.format($outer1$, $middle1$, $inner1$, $myComp1$.component), " "));
|
||||
}
|
||||
}
|
||||
|
||||
function MyComponent_ul_0_li_1_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelementStart(0, "li");
|
||||
$i0$.ɵtemplate(1, MyComponent_ul_0_li_1_div_1_Template, 2, 2, "div", $c1$);
|
||||
$i0$.ɵelementEnd();
|
||||
$i0$.ΔelementStart(0, "li");
|
||||
$i0$.Δtemplate(1, MyComponent_ul_0_li_1_div_1_Template, 2, 2, "div", $c1$);
|
||||
$i0$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
const $myComp2$ = $i0$.ɵnextContext(2);
|
||||
$r3$.ɵselect(1);
|
||||
$i0$.ɵelementProperty(1, "ngForOf", $i0$.ɵbind($myComp2$.items));
|
||||
const $myComp2$ = $i0$.ΔnextContext(2);
|
||||
$r3$.Δselect(1);
|
||||
$i0$.ΔelementProperty(1, "ngForOf", $i0$.Δbind($myComp2$.items));
|
||||
}
|
||||
}
|
||||
|
||||
function MyComponent_ul_0_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelementStart(0, "ul");
|
||||
$i0$.ɵtemplate(1, MyComponent_ul_0_li_1_Template, 2, 1, "li", $c0$);
|
||||
$i0$.ɵelementEnd();
|
||||
$i0$.ΔelementStart(0, "ul");
|
||||
$i0$.Δtemplate(1, MyComponent_ul_0_li_1_Template, 2, 1, "li", $c0$);
|
||||
$i0$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
const $outer2$ = ctx.$implicit;
|
||||
$r3$.ɵselect(1);
|
||||
$i0$.ɵelementProperty(1, "ngForOf", $i0$.ɵbind($outer2$.items));
|
||||
$r3$.Δselect(1);
|
||||
$i0$.ΔelementProperty(1, "ngForOf", $i0$.Δbind($outer2$.items));
|
||||
}
|
||||
}
|
||||
// ...
|
||||
template:function MyComponent_Template(rf, ctx){
|
||||
if (rf & 1) {
|
||||
$i0$.ɵtemplate(0, MyComponent_ul_0_Template, 2, 1, "ul", $c0$);
|
||||
$i0$.Δtemplate(0, MyComponent_ul_0_Template, 2, 1, "ul", $c0$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$i0$.ɵselect(0);
|
||||
$i0$.ɵelementProperty(0, "ngForOf", $i0$.ɵbind(ctx.items));
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "ngForOf", $i0$.Δbind(ctx.items));
|
||||
}
|
||||
}`;
|
||||
|
||||
@ -152,26 +152,26 @@ describe('compiler compliance: template', () => {
|
||||
|
||||
function MyComponent_div_0_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
const $s$ = $r3$.ɵgetCurrentView();
|
||||
$r3$.ɵelementStart(0, "div", $e_attrs$);
|
||||
$r3$.ɵlistener("click", function MyComponent_div_0_Template_div_click_0_listener($event) {
|
||||
$r3$.ɵrestoreView($s$);
|
||||
const $s$ = $r3$.ΔgetCurrentView();
|
||||
$r3$.ΔelementStart(0, "div", $e_attrs$);
|
||||
$r3$.Δlistener("click", function MyComponent_div_0_Template_div_click_0_listener($event) {
|
||||
$r3$.ΔrestoreView($s$);
|
||||
const $d$ = ctx.$implicit;
|
||||
const $i$ = ctx.index;
|
||||
const $comp$ = $r3$.ɵnextContext();
|
||||
const $comp$ = $r3$.ΔnextContext();
|
||||
return $comp$._handleClick($d$, $i$);
|
||||
});
|
||||
$r3$.ɵelementEnd();
|
||||
$r3$.ΔelementEnd();
|
||||
}
|
||||
}
|
||||
// ...
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ɵtemplate(0, MyComponent_div_0_Template, 1, 0, "div", $t0_attrs$);
|
||||
$r3$.Δtemplate(0, MyComponent_div_0_Template, 1, 0, "div", $t0_attrs$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵselect(0);
|
||||
$r3$.ɵelementProperty(0, "ngForOf", $r3$.ɵbind(ctx._data));
|
||||
$r3$.Δselect(0);
|
||||
$r3$.ΔelementProperty(0, "ngForOf", $r3$.Δbind(ctx._data));
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -207,25 +207,25 @@ describe('compiler compliance: template', () => {
|
||||
|
||||
function MyComponent_span_0_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelementStart(0, "span");
|
||||
$i0$.ɵtext(1);
|
||||
$i0$.ɵelementEnd();
|
||||
$i0$.ΔelementStart(0, "span");
|
||||
$i0$.Δtext(1);
|
||||
$i0$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
const $item$ = ctx.$implicit;
|
||||
const $i$ = ctx.index;
|
||||
$r3$.ɵselect(1);
|
||||
$i0$.ɵtextBinding(1, $i0$.ɵinterpolation2(" ", $i$, " - ", $item$, " "));
|
||||
$r3$.Δselect(1);
|
||||
$i0$.ΔtextBinding(1, $i0$.Δinterpolation2(" ", $i$, " - ", $item$, " "));
|
||||
}
|
||||
}
|
||||
// ...
|
||||
template:function MyComponent_Template(rf, ctx){
|
||||
if (rf & 1) {
|
||||
$i0$.ɵtemplate(0, MyComponent_span_0_Template, 2, 2, "span", _c0);
|
||||
$i0$.Δtemplate(0, MyComponent_span_0_Template, 2, 2, "span", _c0);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$i0$.ɵselect(0);
|
||||
$i0$.ɵelementProperty(0, "ngForOf", $i0$.ɵbind(ctx.items));
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "ngForOf", $i0$.Δbind(ctx.items));
|
||||
}
|
||||
}`;
|
||||
|
||||
@ -263,40 +263,40 @@ describe('compiler compliance: template', () => {
|
||||
|
||||
function MyComponent_div_0_span_1_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelementStart(0, "span");
|
||||
$i0$.ɵtext(1);
|
||||
$i0$.ɵelementEnd();
|
||||
$i0$.ΔelementStart(0, "span");
|
||||
$i0$.Δtext(1);
|
||||
$i0$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
const $div$ = $i0$.ɵnextContext();
|
||||
const $div$ = $i0$.ΔnextContext();
|
||||
const $i$ = $div$.index;
|
||||
const $item$ = $div$.$implicit;
|
||||
$r3$.ɵselect(1);
|
||||
$i0$.ɵtextBinding(1, $i0$.ɵinterpolation2(" ", $i$, " - ", $item$, " "));
|
||||
$r3$.Δselect(1);
|
||||
$i0$.ΔtextBinding(1, $i0$.Δinterpolation2(" ", $i$, " - ", $item$, " "));
|
||||
}
|
||||
}
|
||||
|
||||
function MyComponent_div_0_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelementStart(0, "div");
|
||||
$i0$.ɵtemplate(1, MyComponent_div_0_span_1_Template, 2, 2, "span", $c1$);
|
||||
$i0$.ɵelementEnd();
|
||||
$i0$.ΔelementStart(0, "div");
|
||||
$i0$.Δtemplate(1, MyComponent_div_0_span_1_Template, 2, 2, "span", $c1$);
|
||||
$i0$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
const $app$ = $i0$.ɵnextContext();
|
||||
$r3$.ɵselect(1);
|
||||
$i0$.ɵelementProperty(1, "ngIf", $i0$.ɵbind($app$.showing));
|
||||
const $app$ = $i0$.ΔnextContext();
|
||||
$r3$.Δselect(1);
|
||||
$i0$.ΔelementProperty(1, "ngIf", $i0$.Δbind($app$.showing));
|
||||
}
|
||||
}
|
||||
|
||||
// ...
|
||||
template:function MyComponent_Template(rf, ctx){
|
||||
if (rf & 1) {
|
||||
$i0$.ɵtemplate(0, MyComponent_div_0_Template, 2, 1, "div", $c0$);
|
||||
$i0$.Δtemplate(0, MyComponent_div_0_Template, 2, 1, "div", $c0$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$i0$.ɵselect(0);
|
||||
$i0$.ɵelementProperty(0, "ngForOf", $i0$.ɵbind(ctx.items));
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "ngForOf", $i0$.Δbind(ctx.items));
|
||||
}
|
||||
}`;
|
||||
|
||||
@ -335,51 +335,51 @@ describe('compiler compliance: template', () => {
|
||||
const $c0$ = [${AttributeMarker.Template}, "ngFor", "ngForOf"];
|
||||
function MyComponent_div_0_div_1_div_1_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelementStart(0, "div");
|
||||
$i0$.ɵtext(1);
|
||||
$i0$.ɵelementEnd();
|
||||
$i0$.ΔelementStart(0, "div");
|
||||
$i0$.Δtext(1);
|
||||
$i0$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
const $middle$ = $i0$.ɵnextContext().$implicit;
|
||||
const $myComp$ = $i0$.ɵnextContext(2);
|
||||
$r3$.ɵselect(1);
|
||||
$i0$.ɵtextBinding(1, $i0$.ɵinterpolation2(" ", $middle$.value, " - ", $myComp$.name, " "));
|
||||
const $middle$ = $i0$.ΔnextContext().$implicit;
|
||||
const $myComp$ = $i0$.ΔnextContext(2);
|
||||
$r3$.Δselect(1);
|
||||
$i0$.ΔtextBinding(1, $i0$.Δinterpolation2(" ", $middle$.value, " - ", $myComp$.name, " "));
|
||||
}
|
||||
}
|
||||
|
||||
function MyComponent_div_0_div_1_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelementStart(0, "div");
|
||||
$i0$.ɵtemplate(1, MyComponent_div_0_div_1_div_1_Template, 2, 2, "div", $c0$);
|
||||
$i0$.ɵelementEnd();
|
||||
$i0$.ΔelementStart(0, "div");
|
||||
$i0$.Δtemplate(1, MyComponent_div_0_div_1_div_1_Template, 2, 2, "div", $c0$);
|
||||
$i0$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
const $middle$ = ctx.$implicit;
|
||||
$r3$.ɵselect(1);
|
||||
$i0$.ɵelementProperty(1, "ngForOf", $i0$.ɵbind($middle$.items));
|
||||
$r3$.Δselect(1);
|
||||
$i0$.ΔelementProperty(1, "ngForOf", $i0$.Δbind($middle$.items));
|
||||
}
|
||||
}
|
||||
|
||||
function MyComponent_div_0_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelementStart(0, "div");
|
||||
$i0$.ɵtemplate(1, MyComponent_div_0_div_1_Template, 2, 1, "div", $c0$);
|
||||
$i0$.ɵelementEnd();
|
||||
$i0$.ΔelementStart(0, "div");
|
||||
$i0$.Δtemplate(1, MyComponent_div_0_div_1_Template, 2, 1, "div", $c0$);
|
||||
$i0$.ΔelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
const $outer$ = ctx.$implicit;
|
||||
$r3$.ɵselect(1);
|
||||
$i0$.ɵelementProperty(1, "ngForOf", $i0$.ɵbind($outer$.items));
|
||||
$r3$.Δselect(1);
|
||||
$i0$.ΔelementProperty(1, "ngForOf", $i0$.Δbind($outer$.items));
|
||||
}
|
||||
}
|
||||
// ...
|
||||
template:function MyComponent_Template(rf, ctx){
|
||||
if (rf & 1) {
|
||||
$i0$.ɵtemplate(0, MyComponent_div_0_Template, 2, 1, "div", $c0$);
|
||||
$i0$.Δtemplate(0, MyComponent_div_0_Template, 2, 1, "div", $c0$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$i0$.ɵselect(0);
|
||||
$i0$.ɵelementProperty(0, "ngForOf", $i0$.ɵbind(ctx.items));
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "ngForOf", $i0$.Δbind(ctx.items));
|
||||
}
|
||||
}`;
|
||||
|
||||
@ -414,7 +414,7 @@ describe('compiler compliance: template', () => {
|
||||
|
||||
function MyComponent_ng_template_0_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵtext(0, " some-content ");
|
||||
$i0$.Δtext(0, " some-content ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -422,11 +422,11 @@ describe('compiler compliance: template', () => {
|
||||
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵtemplate(0, MyComponent_ng_template_0_Template, 1, 0, "ng-template", $c0$);
|
||||
$i0$.Δtemplate(0, MyComponent_ng_template_0_Template, 1, 0, "ng-template", $c0$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$i0$.ɵselect(0);
|
||||
$i0$.ɵelementProperty(0, "boundAttr", $i0$.ɵbind(ctx.b));
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "boundAttr", $i0$.Δbind(ctx.b));
|
||||
}
|
||||
}`;
|
||||
|
||||
@ -459,7 +459,7 @@ describe('compiler compliance: template', () => {
|
||||
|
||||
function MyComponent_ng_template_0_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵtext(0, "some-content");
|
||||
$i0$.Δtext(0, "some-content");
|
||||
}
|
||||
}
|
||||
|
||||
@ -467,7 +467,7 @@ describe('compiler compliance: template', () => {
|
||||
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵtemplate(0, MyComponent_ng_template_0_Template, 1, 0, "ng-template", null, $t0_refs$, $i0$.ɵtemplateRefExtractor);
|
||||
$i0$.Δtemplate(0, MyComponent_ng_template_0_Template, 1, 0, "ng-template", null, $t0_refs$, $i0$.ΔtemplateRefExtractor);
|
||||
}
|
||||
}`;
|
||||
|
||||
@ -504,8 +504,8 @@ describe('compiler compliance: template', () => {
|
||||
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵtemplate(0, MyComponent_ng_template_0_Template, 0, 0, "ng-template", $t0_attrs$);
|
||||
$i0$.ɵlistener("outDirective", function MyComponent_Template_ng_template_outDirective_0_listener($event) { return $event.doSth(); });
|
||||
$i0$.Δtemplate(0, MyComponent_ng_template_0_Template, 0, 0, "ng-template", $t0_attrs$);
|
||||
$i0$.Δlistener("outDirective", function MyComponent_Template_ng_template_outDirective_0_listener($event) { return $event.doSth(); });
|
||||
}
|
||||
}`;
|
||||
|
||||
@ -657,7 +657,7 @@ describe('compiler compliance: template', () => {
|
||||
|
||||
function MyComponent_div_0_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵelement(0, "div");
|
||||
$i0$.Δelement(0, "div");
|
||||
}
|
||||
}
|
||||
|
||||
@ -665,11 +665,11 @@ describe('compiler compliance: template', () => {
|
||||
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ɵtemplate(0, MyComponent_div_0_Template, 1, 0, "div", $c0$);
|
||||
$i0$.ɵpipe(1, "pipe");
|
||||
$i0$.Δtemplate(0, MyComponent_div_0_Template, 1, 0, "div", $c0$);
|
||||
$i0$.Δpipe(1, "pipe");
|
||||
} if (rf & 2) {
|
||||
$i0$.ɵselect(0);
|
||||
$i0$.ɵelementProperty(0, "ngIf", $i0$.ɵbind($i0$.ɵpipeBind1(1, 1, ctx.val)));
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "ngIf", $i0$.Δbind($i0$.ΔpipeBind1(1, 1, ctx.val)));
|
||||
}
|
||||
}`;
|
||||
|
||||
|
@ -1219,7 +1219,7 @@ describe('ngc transformer command-line', () => {
|
||||
|
||||
write('test.ts', `
|
||||
import {Injectable, NgZone} from '@angular/core';
|
||||
|
||||
|
||||
@Injectable({providedIn: 'root'})
|
||||
export class MyService {
|
||||
constructor(public ngZone: NgZone) {}
|
||||
@ -1285,7 +1285,7 @@ describe('ngc transformer command-line', () => {
|
||||
write('lib2/module.ts', `export {Module} from 'lib1_built/module';`);
|
||||
write('lib2/class2.ts', `
|
||||
import {Class1} from 'lib1_built/class1';
|
||||
|
||||
|
||||
export class Class2 {
|
||||
constructor(class1: Class1) {}
|
||||
}
|
||||
@ -2075,7 +2075,7 @@ describe('ngc transformer command-line', () => {
|
||||
})
|
||||
export class Service {}
|
||||
`);
|
||||
expect(source).toMatch(/ngInjectableDef = .+\.defineInjectable\(/);
|
||||
expect(source).toMatch(/ngInjectableDef = .+\.ΔdefineInjectable\(/);
|
||||
expect(source).toMatch(/ngInjectableDef.*token: Service/);
|
||||
expect(source).toMatch(/ngInjectableDef.*providedIn: .+\.Module/);
|
||||
});
|
||||
@ -2131,7 +2131,7 @@ describe('ngc transformer command-line', () => {
|
||||
})
|
||||
export class Service {}
|
||||
`);
|
||||
expect(source).toMatch(/ngInjectableDef.*return ..\.inject\(Existing\)/);
|
||||
expect(source).toMatch(/ngInjectableDef.*return ..\.Δinject\(Existing\)/);
|
||||
});
|
||||
|
||||
it('compiles a useFactory InjectableDef with optional dep', () => {
|
||||
@ -2151,7 +2151,7 @@ describe('ngc transformer command-line', () => {
|
||||
constructor(e: Existing|null) {}
|
||||
}
|
||||
`);
|
||||
expect(source).toMatch(/ngInjectableDef.*return ..\(..\.inject\(Existing, 8\)/);
|
||||
expect(source).toMatch(/ngInjectableDef.*return ..\(..\.Δinject\(Existing, 8\)/);
|
||||
});
|
||||
|
||||
it('compiles a useFactory InjectableDef with skip-self dep', () => {
|
||||
@ -2171,7 +2171,7 @@ describe('ngc transformer command-line', () => {
|
||||
constructor(e: Existing) {}
|
||||
}
|
||||
`);
|
||||
expect(source).toMatch(/ngInjectableDef.*return ..\(..\.inject\(Existing, 4\)/);
|
||||
expect(source).toMatch(/ngInjectableDef.*return ..\(..\.Δinject\(Existing, 4\)/);
|
||||
});
|
||||
|
||||
it('compiles a service that depends on a token', () => {
|
||||
@ -2188,7 +2188,7 @@ describe('ngc transformer command-line', () => {
|
||||
constructor(@Inject(TOKEN) value: boolean) {}
|
||||
}
|
||||
`);
|
||||
expect(source).toMatch(/ngInjectableDef = .+\.defineInjectable\(/);
|
||||
expect(source).toMatch(/ngInjectableDef = .+\.ΔdefineInjectable\(/);
|
||||
expect(source).toMatch(/ngInjectableDef.*token: Service/);
|
||||
expect(source).toMatch(/ngInjectableDef.*providedIn: .+\.Module/);
|
||||
});
|
||||
@ -2215,7 +2215,7 @@ describe('ngc transformer command-line', () => {
|
||||
constructor(@Inject(TOKEN) token: any) {}
|
||||
}
|
||||
`);
|
||||
expect(source).toMatch(/new Service\(i0\.inject\(exports\.TOKEN\)\);/);
|
||||
expect(source).toMatch(/new Service\(i0\.Δinject\(exports\.TOKEN\)\);/);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -62,8 +62,8 @@ export function forwardRef<T>(fn: () => T): T {
|
||||
|
||||
export interface SimpleChanges { [propName: string]: any; }
|
||||
|
||||
export type ɵNgModuleDefWithMeta<ModuleT, DeclarationsT, ImportsT, ExportsT> = any;
|
||||
export type ɵDirectiveDefWithMeta<DirT, SelectorT, ExportAsT, InputsT, OutputsT, QueriesT> = any;
|
||||
export type ΔNgModuleDefWithMeta<ModuleT, DeclarationsT, ImportsT, ExportsT> = any;
|
||||
export type ΔDirectiveDefWithMeta<DirT, SelectorT, ExportAsT, InputsT, OutputsT, QueriesT> = any;
|
||||
|
||||
export enum ViewEncapsulation {
|
||||
Emulated = 0,
|
||||
@ -75,4 +75,4 @@ export enum ViewEncapsulation {
|
||||
export enum ChangeDetectionStrategy {
|
||||
OnPush = 0,
|
||||
Default = 1
|
||||
}
|
||||
}
|
||||
|
@ -18,12 +18,12 @@ const varRegExp = (name: string): RegExp => new RegExp(`var \\w+ = \\[\"${name}\
|
||||
|
||||
const viewQueryRegExp = (descend: boolean, ref?: string): RegExp => {
|
||||
const maybeRef = ref ? `${ref}` : `null`;
|
||||
return new RegExp(`i0\\.ɵviewQuery\\(\\w+, ${descend}, ${maybeRef}\\)`);
|
||||
return new RegExp(`i0\\.ΔviewQuery\\(\\w+, ${descend}, ${maybeRef}\\)`);
|
||||
};
|
||||
|
||||
const contentQueryRegExp = (predicate: string, descend: boolean, ref?: string): RegExp => {
|
||||
const maybeRef = ref ? `${ref}` : `null`;
|
||||
return new RegExp(`i0\\.ɵcontentQuery\\(dirIndex, ${predicate}, ${descend}, ${maybeRef}\\)`);
|
||||
return new RegExp(`i0\\.ΔcontentQuery\\(dirIndex, ${predicate}, ${descend}, ${maybeRef}\\)`);
|
||||
};
|
||||
|
||||
const setClassMetadataRegExp = (expectedType: string): RegExp =>
|
||||
@ -56,8 +56,8 @@ describe('ngtsc behavioral tests', () => {
|
||||
expect(jsContents).toContain('Service.ngInjectableDef =');
|
||||
expect(jsContents).not.toContain('__decorate');
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵInjectableDef<Dep>;');
|
||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵInjectableDef<Service>;');
|
||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ΔInjectableDef<Dep>;');
|
||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ΔInjectableDef<Service>;');
|
||||
});
|
||||
|
||||
it('should compile Injectables with a generic service', () => {
|
||||
@ -75,7 +75,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('Store.ngInjectableDef =');
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵInjectableDef<Store<any>>;');
|
||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ΔInjectableDef<Store<any>>;');
|
||||
});
|
||||
|
||||
it('should compile Injectables with providedIn without errors', () => {
|
||||
@ -99,11 +99,11 @@ describe('ngtsc behavioral tests', () => {
|
||||
expect(jsContents).toContain('Dep.ngInjectableDef =');
|
||||
expect(jsContents).toContain('Service.ngInjectableDef =');
|
||||
expect(jsContents)
|
||||
.toContain('return new (t || Service)(i0.inject(Dep)); }, providedIn: \'root\' });');
|
||||
.toContain('return new (t || Service)(i0.Δinject(Dep)); }, providedIn: \'root\' });');
|
||||
expect(jsContents).not.toContain('__decorate');
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵInjectableDef<Dep>;');
|
||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵInjectableDef<Service>;');
|
||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ΔInjectableDef<Dep>;');
|
||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ΔInjectableDef<Service>;');
|
||||
});
|
||||
|
||||
it('should compile Injectables with providedIn and factory without errors', () => {
|
||||
@ -128,7 +128,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
expect(jsContents).toContain('return r; }, providedIn: \'root\' });');
|
||||
expect(jsContents).not.toContain('__decorate');
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵInjectableDef<Service>;');
|
||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ΔInjectableDef<Service>;');
|
||||
});
|
||||
|
||||
it('should compile Injectables with providedIn and factory with deps without errors', () => {
|
||||
@ -151,13 +151,13 @@ describe('ngtsc behavioral tests', () => {
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('Service.ngInjectableDef =');
|
||||
expect(jsContents).toContain('factory: function Service_Factory(t) { var r = null; if (t) {');
|
||||
expect(jsContents).toContain('(r = new t(i0.inject(Dep)));');
|
||||
expect(jsContents).toContain('(r = new t(i0.Δinject(Dep)));');
|
||||
expect(jsContents)
|
||||
.toContain('(r = (function (dep) { return new Service(dep); })(i0.inject(Dep)));');
|
||||
.toContain('(r = (function (dep) { return new Service(dep); })(i0.Δinject(Dep)));');
|
||||
expect(jsContents).toContain('return r; }, providedIn: \'root\' });');
|
||||
expect(jsContents).not.toContain('__decorate');
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ɵInjectableDef<Service>;');
|
||||
expect(dtsContents).toContain('static ngInjectableDef: i0.ΔInjectableDef<Service>;');
|
||||
});
|
||||
|
||||
it('should compile @Injectable with an @Optional dependency', () => {
|
||||
@ -193,13 +193,13 @@ describe('ngtsc behavioral tests', () => {
|
||||
env.driveMain();
|
||||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('TestCmp.ngComponentDef = i0.ɵdefineComponent');
|
||||
expect(jsContents).toContain('TestCmp.ngComponentDef = i0.ΔdefineComponent');
|
||||
expect(jsContents).not.toContain('__decorate');
|
||||
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'static ngComponentDef: i0.ɵComponentDefWithMeta<TestCmp, "test-cmp", never, {}, {}, never>');
|
||||
'static ngComponentDef: i0.ΔComponentDefWithMeta<TestCmp, "test-cmp", never, {}, {}, never>');
|
||||
});
|
||||
|
||||
it('should compile Components (dynamic inline template) without errors', () => {
|
||||
@ -217,13 +217,13 @@ describe('ngtsc behavioral tests', () => {
|
||||
env.driveMain();
|
||||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('TestCmp.ngComponentDef = i0.ɵdefineComponent');
|
||||
expect(jsContents).toContain('TestCmp.ngComponentDef = i0.ΔdefineComponent');
|
||||
expect(jsContents).not.toContain('__decorate');
|
||||
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'static ngComponentDef: i0.ɵComponentDefWithMeta<TestCmp, "test-cmp", never, {}, {}, never>');
|
||||
'static ngComponentDef: i0.ΔComponentDefWithMeta<TestCmp, "test-cmp", never, {}, {}, never>');
|
||||
});
|
||||
|
||||
it('should compile Components (function call inline template) without errors', () => {
|
||||
@ -244,13 +244,13 @@ describe('ngtsc behavioral tests', () => {
|
||||
env.driveMain();
|
||||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('TestCmp.ngComponentDef = i0.ɵdefineComponent');
|
||||
expect(jsContents).toContain('TestCmp.ngComponentDef = i0.ΔdefineComponent');
|
||||
expect(jsContents).not.toContain('__decorate');
|
||||
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'static ngComponentDef: i0.ɵComponentDefWithMeta<TestCmp, "test-cmp", never, {}, {}, never>');
|
||||
'static ngComponentDef: i0.ΔComponentDefWithMeta<TestCmp, "test-cmp", never, {}, {}, never>');
|
||||
});
|
||||
|
||||
it('should compile Components (external template) without errors', () => {
|
||||
@ -351,13 +351,13 @@ describe('ngtsc behavioral tests', () => {
|
||||
env.driveMain();
|
||||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('TestBase.ngBaseDef = i0.ɵdefineBase');
|
||||
expect(jsContents).toContain('TestComponent.ngComponentDef = i0.ɵdefineComponent');
|
||||
expect(jsContents).toContain('TestDirective.ngDirectiveDef = i0.ɵdefineDirective');
|
||||
expect(jsContents).toContain('TestPipe.ngPipeDef = i0.ɵdefinePipe');
|
||||
expect(jsContents).toContain('TestInjectable.ngInjectableDef = i0.defineInjectable');
|
||||
expect(jsContents).toContain('MyModule.ngModuleDef = i0.ɵdefineNgModule');
|
||||
expect(jsContents).toContain('MyModule.ngInjectorDef = i0.defineInjector');
|
||||
expect(jsContents).toContain('TestBase.ngBaseDef = i0.ΔdefineBase');
|
||||
expect(jsContents).toContain('TestComponent.ngComponentDef = i0.ΔdefineComponent');
|
||||
expect(jsContents).toContain('TestDirective.ngDirectiveDef = i0.ΔdefineDirective');
|
||||
expect(jsContents).toContain('TestPipe.ngPipeDef = i0.ΔdefinePipe');
|
||||
expect(jsContents).toContain('TestInjectable.ngInjectableDef = i0.ΔdefineInjectable');
|
||||
expect(jsContents).toContain('MyModule.ngModuleDef = i0.ΔdefineNgModule');
|
||||
expect(jsContents).toContain('MyModule.ngInjectorDef = i0.ΔdefineInjector');
|
||||
expect(jsContents).toContain('inputs: { input: "input" }');
|
||||
expect(jsContents).toContain('outputs: { output: "output" }');
|
||||
});
|
||||
@ -442,25 +442,25 @@ describe('ngtsc behavioral tests', () => {
|
||||
env.driveMain();
|
||||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('i0.ɵdefineNgModule({ type: TestModule, bootstrap: [TestCmp] });');
|
||||
expect(jsContents).toContain('i0.ΔdefineNgModule({ type: TestModule, bootstrap: [TestCmp] });');
|
||||
expect(jsContents)
|
||||
.toContain('/*@__PURE__*/ i0.ɵsetNgModuleScope(TestModule, { declarations: [TestCmp] });');
|
||||
.toContain('/*@__PURE__*/ i0.ΔsetNgModuleScope(TestModule, { declarations: [TestCmp] });');
|
||||
expect(jsContents)
|
||||
.toContain(
|
||||
'i0.defineInjector({ factory: ' +
|
||||
'i0.ΔdefineInjector({ factory: ' +
|
||||
'function TestModule_Factory(t) { return new (t || TestModule)(); } });');
|
||||
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'static ngComponentDef: i0.ɵComponentDefWithMeta<TestCmp, "test-cmp", never, {}, {}, never>');
|
||||
'static ngComponentDef: i0.ΔComponentDefWithMeta<TestCmp, "test-cmp", never, {}, {}, never>');
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'static ngModuleDef: i0.ɵNgModuleDefWithMeta<TestModule, [typeof TestCmp], never, never>');
|
||||
'static ngModuleDef: i0.ΔNgModuleDefWithMeta<TestModule, [typeof TestCmp], never, never>');
|
||||
expect(dtsContents).not.toContain('__decorate');
|
||||
});
|
||||
|
||||
it('should not emit a setNgModuleScope call when no scope metadata is present', () => {
|
||||
it('should not emit a ΔsetNgModuleScope call when no scope metadata is present', () => {
|
||||
env.tsconfig();
|
||||
env.write('test.ts', `
|
||||
import {NgModule} from '@angular/core';
|
||||
@ -472,8 +472,8 @@ describe('ngtsc behavioral tests', () => {
|
||||
env.driveMain();
|
||||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('i0.ɵdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents).not.toContain('ɵsetNgModuleScope(TestModule,');
|
||||
expect(jsContents).toContain('i0.ΔdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents).not.toContain('ΔsetNgModuleScope(TestModule,');
|
||||
});
|
||||
|
||||
it('should filter out directives and pipes from module exports in the injector def', () => {
|
||||
@ -488,7 +488,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
exports: [OtherDir],
|
||||
})
|
||||
export class OtherModule {}
|
||||
|
||||
|
||||
const EXPORTS = [Dir, MyPipe, Comp, OtherModule, OtherDir, RouterModule, RouterComp];
|
||||
|
||||
@NgModule({
|
||||
@ -514,15 +514,15 @@ describe('ngtsc behavioral tests', () => {
|
||||
export class Comp {}
|
||||
`);
|
||||
env.write('node_modules/@angular/router/index.d.ts', `
|
||||
import {ɵComponentDefWithMeta, ModuleWithProviders, ɵNgModuleDefWithMeta} from '@angular/core';
|
||||
import {ΔComponentDefWithMeta, ModuleWithProviders, ΔNgModuleDefWithMeta} from '@angular/core';
|
||||
|
||||
export declare class RouterComp {
|
||||
static ngComponentDef: ɵComponentDefWithMeta<RouterComp, "lib-cmp", never, {}, {}, never>
|
||||
static ngComponentDef: ΔComponentDefWithMeta<RouterComp, "lib-cmp", never, {}, {}, never>
|
||||
}
|
||||
|
||||
declare class RouterModule {
|
||||
static forRoot(): ModuleWithProviders<RouterModule>;
|
||||
static ngModuleDef: ɵNgModuleDefWithMeta<RouterModule, [typeof RouterComp], never, [typeof RouterComp]>;
|
||||
static ngModuleDef: ΔNgModuleDefWithMeta<RouterModule, [typeof RouterComp], never, [typeof RouterComp]>;
|
||||
}
|
||||
`);
|
||||
|
||||
@ -531,7 +531,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents)
|
||||
.toContain(
|
||||
'i0.defineInjector({ factory: function TestModule_Factory(t) ' +
|
||||
'i0.ΔdefineInjector({ factory: function TestModule_Factory(t) ' +
|
||||
'{ return new (t || TestModule)(); }, imports: [[OtherModule, RouterModule.forRoot()],' +
|
||||
'\n OtherModule,\n RouterModule] });');
|
||||
});
|
||||
@ -563,18 +563,18 @@ describe('ngtsc behavioral tests', () => {
|
||||
env.driveMain();
|
||||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('i0.ɵdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents).toContain('i0.ΔdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents)
|
||||
.toContain(
|
||||
`TestModule.ngInjectorDef = i0.defineInjector({ factory: ` +
|
||||
`TestModule.ngInjectorDef = i0.ΔdefineInjector({ factory: ` +
|
||||
`function TestModule_Factory(t) { return new (t || TestModule)(); }, providers: [{ provide: ` +
|
||||
`Token, useValue: 'test' }], imports: [[OtherModule]] });`);
|
||||
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'static ngModuleDef: i0.ɵNgModuleDefWithMeta<TestModule, [typeof TestCmp], [typeof OtherModule], never>');
|
||||
expect(dtsContents).toContain('static ngInjectorDef: i0.ɵInjectorDef');
|
||||
'static ngModuleDef: i0.ΔNgModuleDefWithMeta<TestModule, [typeof TestCmp], [typeof OtherModule], never>');
|
||||
expect(dtsContents).toContain('static ngInjectorDef: i0.ΔInjectorDef');
|
||||
});
|
||||
|
||||
it('should compile NgModules with factory providers without errors', () => {
|
||||
@ -604,18 +604,18 @@ describe('ngtsc behavioral tests', () => {
|
||||
env.driveMain();
|
||||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('i0.ɵdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents).toContain('i0.ΔdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents)
|
||||
.toContain(
|
||||
`TestModule.ngInjectorDef = i0.defineInjector({ factory: ` +
|
||||
`TestModule.ngInjectorDef = i0.ΔdefineInjector({ factory: ` +
|
||||
`function TestModule_Factory(t) { return new (t || TestModule)(); }, providers: [{ provide: ` +
|
||||
`Token, useFactory: function () { return new Token(); } }], imports: [[OtherModule]] });`);
|
||||
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'static ngModuleDef: i0.ɵNgModuleDefWithMeta<TestModule, [typeof TestCmp], [typeof OtherModule], never>');
|
||||
expect(dtsContents).toContain('static ngInjectorDef: i0.ɵInjectorDef');
|
||||
'static ngModuleDef: i0.ΔNgModuleDefWithMeta<TestModule, [typeof TestCmp], [typeof OtherModule], never>');
|
||||
expect(dtsContents).toContain('static ngInjectorDef: i0.ΔInjectorDef');
|
||||
});
|
||||
|
||||
it('should compile NgModules with factory providers and deps without errors', () => {
|
||||
@ -649,18 +649,18 @@ describe('ngtsc behavioral tests', () => {
|
||||
env.driveMain();
|
||||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('i0.ɵdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents).toContain('i0.ΔdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents)
|
||||
.toContain(
|
||||
`TestModule.ngInjectorDef = i0.defineInjector({ factory: ` +
|
||||
`TestModule.ngInjectorDef = i0.ΔdefineInjector({ factory: ` +
|
||||
`function TestModule_Factory(t) { return new (t || TestModule)(); }, providers: [{ provide: ` +
|
||||
`Token, useFactory: function (dep) { return new Token(dep); }, deps: [Dep] }], imports: [[OtherModule]] });`);
|
||||
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'static ngModuleDef: i0.ɵNgModuleDefWithMeta<TestModule, [typeof TestCmp], [typeof OtherModule], never>');
|
||||
expect(dtsContents).toContain('static ngInjectorDef: i0.ɵInjectorDef');
|
||||
'static ngModuleDef: i0.ΔNgModuleDefWithMeta<TestModule, [typeof TestCmp], [typeof OtherModule], never>');
|
||||
expect(dtsContents).toContain('static ngInjectorDef: i0.ΔInjectorDef');
|
||||
});
|
||||
|
||||
it('should compile NgModules with references to local components', () => {
|
||||
@ -821,9 +821,9 @@ describe('ngtsc behavioral tests', () => {
|
||||
|
||||
expect(jsContents)
|
||||
.toContain(
|
||||
'TestPipe.ngPipeDef = i0.ɵdefinePipe({ name: "test-pipe", type: TestPipe, ' +
|
||||
'TestPipe.ngPipeDef = i0.ΔdefinePipe({ name: "test-pipe", type: TestPipe, ' +
|
||||
'factory: function TestPipe_Factory(t) { return new (t || TestPipe)(); }, pure: false })');
|
||||
expect(dtsContents).toContain('static ngPipeDef: i0.ɵPipeDefWithMeta<TestPipe, "test-pipe">;');
|
||||
expect(dtsContents).toContain('static ngPipeDef: i0.ΔPipeDefWithMeta<TestPipe, "test-pipe">;');
|
||||
});
|
||||
|
||||
it('should compile pure Pipes without errors', () => {
|
||||
@ -844,9 +844,9 @@ describe('ngtsc behavioral tests', () => {
|
||||
|
||||
expect(jsContents)
|
||||
.toContain(
|
||||
'TestPipe.ngPipeDef = i0.ɵdefinePipe({ name: "test-pipe", type: TestPipe, ' +
|
||||
'TestPipe.ngPipeDef = i0.ΔdefinePipe({ name: "test-pipe", type: TestPipe, ' +
|
||||
'factory: function TestPipe_Factory(t) { return new (t || TestPipe)(); }, pure: true })');
|
||||
expect(dtsContents).toContain('static ngPipeDef: i0.ɵPipeDefWithMeta<TestPipe, "test-pipe">;');
|
||||
expect(dtsContents).toContain('static ngPipeDef: i0.ΔPipeDefWithMeta<TestPipe, "test-pipe">;');
|
||||
});
|
||||
|
||||
it('should compile Pipes with dependencies', () => {
|
||||
@ -868,7 +868,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
env.driveMain();
|
||||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('return new (t || TestPipe)(i0.ɵdirectiveInject(Dep));');
|
||||
expect(jsContents).toContain('return new (t || TestPipe)(i0.ΔdirectiveInject(Dep));');
|
||||
});
|
||||
|
||||
it('should compile Pipes with generic types', () => {
|
||||
@ -888,7 +888,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
expect(jsContents).toContain('TestPipe.ngPipeDef =');
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents)
|
||||
.toContain('static ngPipeDef: i0.ɵPipeDefWithMeta<TestPipe<any>, "test-pipe">;');
|
||||
.toContain('static ngPipeDef: i0.ΔPipeDefWithMeta<TestPipe<any>, "test-pipe">;');
|
||||
});
|
||||
|
||||
it('should include @Pipes in @NgModule scopes', () => {
|
||||
@ -914,7 +914,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'i0.ɵNgModuleDefWithMeta<TestModule, [typeof TestPipe, typeof TestCmp], never, never>');
|
||||
'i0.ΔNgModuleDefWithMeta<TestModule, [typeof TestPipe, typeof TestCmp], never, never>');
|
||||
});
|
||||
|
||||
describe('empty and missing selectors', () => {
|
||||
@ -1029,7 +1029,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
expect(dtsContents).toContain('ComponentDefWithMeta<TestCmp');
|
||||
expect(dtsContents).toContain('DirectiveDefWithMeta<TestDir');
|
||||
expect(dtsContents).toContain('PipeDefWithMeta<TestPipe');
|
||||
expect(dtsContents).toContain('NgModuleDefWithMeta<TestNgModule');
|
||||
expect(dtsContents).toContain('ΔNgModuleDefWithMeta<TestNgModule');
|
||||
|
||||
// Validate that each class's .d.ts declaration also has an injectable definition.
|
||||
expect(dtsContents).toContain('InjectableDef<TestCmp');
|
||||
@ -1254,7 +1254,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
`);
|
||||
|
||||
env.driveMain();
|
||||
expect(env.getContents('test.js')).toContain('i0.ɵpureFunction1');
|
||||
expect(env.getContents('test.js')).toContain('i0.ΔpureFunction1');
|
||||
});
|
||||
|
||||
it('should compile array literals inside function arguments', () => {
|
||||
@ -1276,7 +1276,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
`);
|
||||
|
||||
env.driveMain();
|
||||
expect(env.getContents('test.js')).toContain('i0.ɵpureFunction1');
|
||||
expect(env.getContents('test.js')).toContain('i0.ΔpureFunction1');
|
||||
});
|
||||
});
|
||||
|
||||
@ -1292,11 +1292,11 @@ describe('ngtsc behavioral tests', () => {
|
||||
`);
|
||||
|
||||
env.write('node_modules/router/index.d.ts', `
|
||||
import {ModuleWithProviders, ɵNgModuleDefWithMeta} from '@angular/core';
|
||||
import {ModuleWithProviders, ΔNgModuleDefWithMeta} from '@angular/core';
|
||||
|
||||
declare class RouterModule {
|
||||
static forRoot(): ModuleWithProviders<RouterModule>;
|
||||
static ngModuleDef: ɵNgModuleDefWithMeta<RouterModule, never, never, never>;
|
||||
static ngModuleDef: ΔNgModuleDefWithMeta<RouterModule, never, never, never>;
|
||||
}
|
||||
`);
|
||||
|
||||
@ -1308,7 +1308,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents).toContain(`import * as i1 from "router";`);
|
||||
expect(dtsContents)
|
||||
.toContain('i0.ɵNgModuleDefWithMeta<TestModule, never, [typeof i1.RouterModule], never>');
|
||||
.toContain('i0.ΔNgModuleDefWithMeta<TestModule, never, [typeof i1.RouterModule], never>');
|
||||
});
|
||||
|
||||
it('should extract the generic type if it is provided as qualified type name', () => {
|
||||
@ -1333,9 +1333,9 @@ describe('ngtsc behavioral tests', () => {
|
||||
`);
|
||||
|
||||
env.write('node_modules/router/internal.d.ts', `
|
||||
import {ɵNgModuleDefWithMeta} from '@angular/core';
|
||||
import {ΔNgModuleDefWithMeta} from '@angular/core';
|
||||
export declare class InternalRouterModule {
|
||||
static ngModuleDef: ɵNgModuleDefWithMeta<InternalRouterModule, never, never, never>;
|
||||
static ngModuleDef: ΔNgModuleDefWithMeta<InternalRouterModule, never, never, never>;
|
||||
}
|
||||
`);
|
||||
|
||||
@ -1348,18 +1348,18 @@ describe('ngtsc behavioral tests', () => {
|
||||
expect(dtsContents).toContain(`import * as i1 from "router";`);
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'i0.ɵNgModuleDefWithMeta<TestModule, never, [typeof i1.InternalRouterModule], never>');
|
||||
'i0.ΔNgModuleDefWithMeta<TestModule, never, [typeof i1.InternalRouterModule], never>');
|
||||
});
|
||||
|
||||
it('should not reference a constant with a ModuleWithProviders value in ngModuleDef imports',
|
||||
() => {
|
||||
env.tsconfig();
|
||||
env.write('dep.d.ts', `
|
||||
import {ModuleWithProviders, ɵNgModuleDefWithMeta as NgModuleDefWithMeta} from '@angular/core';
|
||||
import {ModuleWithProviders, ΔNgModuleDefWithMeta as ΔNgModuleDefWithMeta} from '@angular/core';
|
||||
|
||||
export declare class DepModule {
|
||||
static forRoot(arg1: any, arg2: any): ModuleWithProviders<DepModule>;
|
||||
static ngModuleDef: NgModuleDefWithMeta<DepModule, never, never, never>;
|
||||
static ngModuleDef: ΔNgModuleDefWithMeta<DepModule, never, never, never>;
|
||||
}
|
||||
`);
|
||||
env.write('test.ts', `
|
||||
@ -1394,13 +1394,13 @@ describe('ngtsc behavioral tests', () => {
|
||||
`);
|
||||
|
||||
env.write('node_modules/router/index.d.ts', `
|
||||
import {ModuleWithProviders, ɵNgModuleDefWithMeta} from '@angular/core';
|
||||
import {ModuleWithProviders, ΔNgModuleDefWithMeta} from '@angular/core';
|
||||
|
||||
export interface MyType extends ModuleWithProviders {}
|
||||
|
||||
declare class RouterModule {
|
||||
static forRoot(): (MyType)&{ngModule:RouterModule};
|
||||
static ngModuleDef: ɵNgModuleDefWithMeta<RouterModule, never, never, never>;
|
||||
static ngModuleDef: ΔNgModuleDefWithMeta<RouterModule, never, never, never>;
|
||||
}
|
||||
`);
|
||||
|
||||
@ -1413,7 +1413,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
expect(dtsContents).toContain(`import * as i1 from "router";`);
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'i0.ɵNgModuleDefWithMeta<TestModule, never, [typeof i1.RouterModule], never>');
|
||||
'i0.ΔNgModuleDefWithMeta<TestModule, never, [typeof i1.RouterModule], never>');
|
||||
});
|
||||
|
||||
it('should unwrap a namespace imported ModuleWithProviders function if a generic type is provided for it',
|
||||
@ -1433,7 +1433,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
|
||||
declare class RouterModule {
|
||||
static forRoot(): core.ModuleWithProviders<RouterModule>;
|
||||
static ngModuleDef: ɵNgModuleDefWithMeta<RouterModule, never, never, never>;
|
||||
static ngModuleDef: ΔNgModuleDefWithMeta<RouterModule, never, never, never>;
|
||||
}
|
||||
`);
|
||||
|
||||
@ -1446,7 +1446,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
expect(dtsContents).toContain(`import * as i1 from "router";`);
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'i0.ɵNgModuleDefWithMeta<TestModule, never, [typeof i1.RouterModule], never>');
|
||||
'i0.ΔNgModuleDefWithMeta<TestModule, never, [typeof i1.RouterModule], never>');
|
||||
});
|
||||
|
||||
it('should inject special types according to the metadata', () => {
|
||||
@ -1484,7 +1484,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents)
|
||||
.toContain(
|
||||
`factory: 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)); }`);
|
||||
`factory: 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', () => {
|
||||
@ -1514,9 +1514,9 @@ describe('ngtsc behavioral tests', () => {
|
||||
expect(jsContents).toMatch(varRegExp('test1'));
|
||||
expect(jsContents).toMatch(varRegExp('test2'));
|
||||
expect(jsContents).toMatch(varRegExp('accessor'));
|
||||
// match `i0.ɵcontentQuery(dirIndex, _c1, true, TemplateRef)`
|
||||
// match `i0.ΔcontentQuery(dirIndex, _c1, true, TemplateRef)`
|
||||
expect(jsContents).toMatch(contentQueryRegExp('\\w+', true, 'TemplateRef'));
|
||||
// match `i0.ɵviewQuery(_c2, true, null)`
|
||||
// match `i0.ΔviewQuery(_c2, true, null)`
|
||||
expect(jsContents).toMatch(viewQueryRegExp(true));
|
||||
});
|
||||
|
||||
@ -1546,10 +1546,10 @@ describe('ngtsc behavioral tests', () => {
|
||||
expect(jsContents).toMatch(varRegExp('test1'));
|
||||
expect(jsContents).toMatch(varRegExp('test2'));
|
||||
expect(jsContents).toMatch(varRegExp('accessor'));
|
||||
// match `i0.ɵcontentQuery(dirIndex, _c1, true, TemplateRef)`
|
||||
// match `i0.ΔcontentQuery(dirIndex, _c1, true, TemplateRef)`
|
||||
expect(jsContents).toMatch(contentQueryRegExp('\\w+', true, 'TemplateRef'));
|
||||
|
||||
// match `i0.ɵviewQuery(_c2, true, null)`
|
||||
// match `i0.ΔviewQuery(_c2, true, null)`
|
||||
// Note that while ViewQuery doesn't necessarily make sense on a directive, because it doesn't
|
||||
// have a view, we still need to handle it because a component could extend the directive.
|
||||
expect(jsContents).toMatch(viewQueryRegExp(true));
|
||||
@ -1573,9 +1573,9 @@ describe('ngtsc behavioral tests', () => {
|
||||
|
||||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
// match `i0.ɵcontentQuery(dirIndex, TemplateRef, true, null)`
|
||||
// match `i0.ΔcontentQuery(dirIndex, TemplateRef, true, null)`
|
||||
expect(jsContents).toMatch(contentQueryRegExp('TemplateRef', true));
|
||||
// match `i0.ɵcontentQuery(dirIndex, ViewContainerRef, true, null)`
|
||||
// match `i0.ΔcontentQuery(dirIndex, ViewContainerRef, true, null)`
|
||||
expect(jsContents).toMatch(contentQueryRegExp('ViewContainerRef', true));
|
||||
});
|
||||
|
||||
@ -1624,9 +1624,9 @@ describe('ngtsc behavioral tests', () => {
|
||||
const hostBindingsFn = `
|
||||
hostBindings: function FooCmp_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
i0.ɵlistener("click", function FooCmp_click_HostBindingHandler($event) { return ctx.onClick(); });
|
||||
i0.ɵlistener("click", function FooCmp_click_HostBindingHandler($event) { return ctx.onDocumentClick($event.target); }, false, i0.ɵresolveDocument);
|
||||
i0.ɵlistener("scroll", function FooCmp_scroll_HostBindingHandler($event) { return ctx.onWindowScroll(); }, false, i0.ɵresolveWindow);
|
||||
i0.Δlistener("click", function FooCmp_click_HostBindingHandler($event) { return ctx.onClick(); });
|
||||
i0.Δlistener("click", function FooCmp_click_HostBindingHandler($event) { return ctx.onDocumentClick($event.target); }, false, i0.ΔresolveDocument);
|
||||
i0.Δlistener("scroll", function FooCmp_scroll_HostBindingHandler($event) { return ctx.onWindowScroll(); }, false, i0.ΔresolveWindow);
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -1722,17 +1722,17 @@ describe('ngtsc behavioral tests', () => {
|
||||
const hostBindingsFn = `
|
||||
hostBindings: function FooCmp_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
i0.ɵallocHostVars(2);
|
||||
i0.ɵlistener("click", function FooCmp_click_HostBindingHandler($event) { return ctx.onClick($event); });
|
||||
i0.ɵlistener("click", function FooCmp_click_HostBindingHandler($event) { return ctx.onBodyClick($event); }, false, i0.ɵresolveBody);
|
||||
i0.ɵlistener("change", function FooCmp_change_HostBindingHandler($event) { return ctx.onChange(ctx.arg1, ctx.arg2, ctx.arg3); });
|
||||
i0.ɵelementHostStyling(_c0);
|
||||
i0.ΔallocHostVars(2);
|
||||
i0.Δlistener("click", function FooCmp_click_HostBindingHandler($event) { return ctx.onClick($event); });
|
||||
i0.Δlistener("click", function FooCmp_click_HostBindingHandler($event) { return ctx.onBodyClick($event); }, false, i0.ΔresolveBody);
|
||||
i0.Δlistener("change", function FooCmp_change_HostBindingHandler($event) { return ctx.onChange(ctx.arg1, ctx.arg2, ctx.arg3); });
|
||||
i0.ΔelementHostStyling(_c0);
|
||||
}
|
||||
if (rf & 2) {
|
||||
i0.ɵelementAttribute(elIndex, "hello", i0.ɵbind(ctx.foo));
|
||||
i0.ɵelementProperty(elIndex, "prop", i0.ɵbind(ctx.bar), null, true);
|
||||
i0.ɵelementHostClassProp(0, ctx.someClass);
|
||||
i0.ɵelementHostStylingApply();
|
||||
i0.ΔelementAttribute(elIndex, "hello", i0.Δbind(ctx.foo));
|
||||
i0.ΔelementProperty(elIndex, "prop", i0.Δbind(ctx.bar), null, true);
|
||||
i0.ΔelementHostClassProp(0, ctx.someClass);
|
||||
i0.ΔelementHostStylingApply();
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -1761,7 +1761,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
`);
|
||||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('i0.ɵelementHostAttrs(["test", test])');
|
||||
expect(jsContents).toContain('i0.ΔelementHostAttrs(["test", test])');
|
||||
});
|
||||
|
||||
it('should accept enum values as host bindings', () => {
|
||||
@ -1786,7 +1786,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
`);
|
||||
|
||||
env.driveMain();
|
||||
expect(env.getContents('test.js')).toContain('"hello", i0.ɵbind(ctx.foo)');
|
||||
expect(env.getContents('test.js')).toContain('"hello", i0.Δbind(ctx.foo)');
|
||||
});
|
||||
|
||||
it('should generate host listeners for directives within hostBindings section', () => {
|
||||
@ -1808,7 +1808,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
const hostBindingsFn = `
|
||||
hostBindings: function Dir_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
i0.ɵlistener("change", function Dir_change_HostBindingHandler($event) { return ctx.onChange(ctx.arg); });
|
||||
i0.Δlistener("change", function Dir_change_HostBindingHandler($event) { return ctx.onChange(ctx.arg); });
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -2003,7 +2003,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
`);
|
||||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).not.toContain('i0.ɵelementProperty');
|
||||
expect(jsContents).not.toContain('i0.ΔelementProperty');
|
||||
});
|
||||
|
||||
it('should correctly recognize local symbols', () => {
|
||||
@ -2258,8 +2258,8 @@ describe('ngtsc behavioral tests', () => {
|
||||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents)
|
||||
.toContain('function Base_Factory(t) { return new (t || Base)(i0.inject(Dep)); }');
|
||||
expect(jsContents).toContain('var ɵChild_BaseFactory = i0.ɵgetInheritedFactory(Child)');
|
||||
.toContain('function Base_Factory(t) { return new (t || Base)(i0.Δinject(Dep)); }');
|
||||
expect(jsContents).toContain('var ɵChild_BaseFactory = i0.ΔgetInheritedFactory(Child)');
|
||||
expect(jsContents)
|
||||
.toContain('function Child_Factory(t) { return ɵChild_BaseFactory((t || Child)); }');
|
||||
expect(jsContents)
|
||||
@ -2284,7 +2284,7 @@ describe('ngtsc behavioral tests', () => {
|
||||
env.driveMain();
|
||||
const jsContents = env.getContents('test.js');
|
||||
|
||||
expect(jsContents).toContain('var ɵDir_BaseFactory = i0.ɵgetInheritedFactory(Dir)');
|
||||
expect(jsContents).toContain('var ɵDir_BaseFactory = i0.ΔgetInheritedFactory(Dir)');
|
||||
});
|
||||
|
||||
it('should wrap "directives" in component metadata in a closure when forward references are present',
|
||||
@ -2425,8 +2425,8 @@ describe('ngtsc behavioral tests', () => {
|
||||
const jsContents = trim(env.getContents('test.js'));
|
||||
expect(jsContents).toContain(`import Default from './types';`);
|
||||
expect(jsContents).toContain(`import * as i1 from "./types";`);
|
||||
expect(jsContents).toContain('i0.ɵdirectiveInject(Default)');
|
||||
expect(jsContents).toContain('i0.ɵdirectiveInject(i1.Other)');
|
||||
expect(jsContents).toContain('i0.ΔdirectiveInject(Default)');
|
||||
expect(jsContents).toContain('i0.ΔdirectiveInject(i1.Other)');
|
||||
expect(jsContents).toMatch(setClassMetadataRegExp('type: Default'));
|
||||
expect(jsContents).toMatch(setClassMetadataRegExp('type: i1.Other'));
|
||||
});
|
||||
@ -2537,8 +2537,8 @@ describe('ngtsc behavioral tests', () => {
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents)
|
||||
.toMatch(
|
||||
/i\d\.ɵsetComponentScope\(NormalComponent,\s+\[NormalComponent,\s+CyclicComponent\],\s+\[\]\)/);
|
||||
expect(jsContents).not.toContain('/*__PURE__*/ i0.ɵsetComponentScope');
|
||||
/i\d\.ΔsetComponentScope\(NormalComponent,\s+\[NormalComponent,\s+CyclicComponent\],\s+\[\]\)/);
|
||||
expect(jsContents).not.toContain('/*__PURE__*/ i0.ΔsetComponentScope');
|
||||
});
|
||||
|
||||
it('should detect a cycle added entirely during compilation', () => {
|
||||
@ -2729,14 +2729,14 @@ describe('ngtsc behavioral tests', () => {
|
||||
it('should not emit multiple references to the same directive', () => {
|
||||
env.tsconfig();
|
||||
env.write('node_modules/external/index.d.ts', `
|
||||
import {ɵDirectiveDefWithMeta, ɵNgModuleDefWithMeta} from '@angular/core';
|
||||
import {ΔDirectiveDefWithMeta, ΔNgModuleDefWithMeta} from '@angular/core';
|
||||
|
||||
export declare class ExternalDir {
|
||||
static ngDirectiveDef: ɵDirectiveDefWithMeta<ExternalDir, '[test]', never, never, never, never>;
|
||||
static ngDirectiveDef: ΔDirectiveDefWithMeta<ExternalDir, '[test]', never, never, never, never>;
|
||||
}
|
||||
|
||||
export declare class ExternalModule {
|
||||
static ngModuleDef: ɵNgModuleDefWithMeta<ExternalModule, [typeof ExternalDir], never, [typeof ExternalDir]>;
|
||||
static ngModuleDef: ΔNgModuleDefWithMeta<ExternalModule, [typeof ExternalDir], never, [typeof ExternalDir]>;
|
||||
}
|
||||
`);
|
||||
env.write('test.ts', `
|
||||
@ -2765,19 +2765,19 @@ describe('ngtsc behavioral tests', () => {
|
||||
it('should import directives by their external name', () => {
|
||||
env.tsconfig();
|
||||
env.write('node_modules/external/index.d.ts', `
|
||||
import {ɵDirectiveDefWithMeta, ɵNgModuleDefWithMeta} from '@angular/core';
|
||||
import {ΔDirectiveDefWithMeta, ΔNgModuleDefWithMeta} from '@angular/core';
|
||||
import {InternalDir} from './internal';
|
||||
|
||||
export {InternalDir as ExternalDir} from './internal';
|
||||
|
||||
export declare class ExternalModule {
|
||||
static ngModuleDef: ɵNgModuleDefWithMeta<ExternalModule, [typeof InternalDir], never, [typeof InternalDir]>;
|
||||
static ngModuleDef: ΔNgModuleDefWithMeta<ExternalModule, [typeof InternalDir], never, [typeof InternalDir]>;
|
||||
}
|
||||
`);
|
||||
env.write('node_modules/external/internal.d.ts', `
|
||||
|
||||
export declare class InternalDir {
|
||||
static ngDirectiveDef: ɵDirectiveDefWithMeta<InternalDir, '[test]', never, never, never, never>;
|
||||
static ngDirectiveDef: ΔDirectiveDefWithMeta<InternalDir, '[test]', never, never, never, never>;
|
||||
}
|
||||
`);
|
||||
env.write('test.ts', `
|
||||
@ -2986,14 +2986,14 @@ describe('ngtsc behavioral tests', () => {
|
||||
export class Module {}
|
||||
`);
|
||||
env.write('node_modules/external/index.d.ts', `
|
||||
import {ɵDirectiveDefWithMeta, ɵNgModuleDefWithMeta} from '@angular/core';
|
||||
import {ΔDirectiveDefWithMeta, ΔNgModuleDefWithMeta} from '@angular/core';
|
||||
|
||||
export declare class ExternalDir {
|
||||
static ngDirectiveDef: ɵDirectiveDefWithMeta<ExternalDir, '[test]', never, never, never, never>;
|
||||
static ngDirectiveDef: ΔDirectiveDefWithMeta<ExternalDir, '[test]', never, never, never, never>;
|
||||
}
|
||||
|
||||
export declare class ExternalModule {
|
||||
static ngModuleDef: ɵNgModuleDefWithMeta<ExternalModule, [typeof ExternalDir], never, [typeof ExternalDir]>;
|
||||
static ngModuleDef: ΔNgModuleDefWithMeta<ExternalModule, [typeof ExternalDir], never, [typeof ExternalDir]>;
|
||||
}
|
||||
`);
|
||||
|
||||
@ -3173,15 +3173,15 @@ describe('ngtsc behavioral tests', () => {
|
||||
const hostBindingsFn = `
|
||||
hostBindings: function UnsafeAttrsDirective_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
i0.ɵallocHostVars(6);
|
||||
i0.ΔallocHostVars(6);
|
||||
}
|
||||
if (rf & 2) {
|
||||
i0.ɵelementAttribute(elIndex, "href", i0.ɵbind(ctx.attrHref), i0.ɵsanitizeUrlOrResourceUrl);
|
||||
i0.ɵelementAttribute(elIndex, "src", i0.ɵbind(ctx.attrSrc), i0.ɵsanitizeUrlOrResourceUrl);
|
||||
i0.ɵelementAttribute(elIndex, "action", i0.ɵbind(ctx.attrAction), i0.ɵsanitizeUrl);
|
||||
i0.ɵelementAttribute(elIndex, "profile", i0.ɵbind(ctx.attrProfile), i0.ɵsanitizeResourceUrl);
|
||||
i0.ɵelementAttribute(elIndex, "innerHTML", i0.ɵbind(ctx.attrInnerHTML), i0.ɵsanitizeHtml);
|
||||
i0.ɵelementAttribute(elIndex, "title", i0.ɵbind(ctx.attrSafeTitle));
|
||||
i0.ΔelementAttribute(elIndex, "href", i0.Δbind(ctx.attrHref), i0.ΔsanitizeUrlOrResourceUrl);
|
||||
i0.ΔelementAttribute(elIndex, "src", i0.Δbind(ctx.attrSrc), i0.ΔsanitizeUrlOrResourceUrl);
|
||||
i0.ΔelementAttribute(elIndex, "action", i0.Δbind(ctx.attrAction), i0.ΔsanitizeUrl);
|
||||
i0.ΔelementAttribute(elIndex, "profile", i0.Δbind(ctx.attrProfile), i0.ΔsanitizeResourceUrl);
|
||||
i0.ΔelementAttribute(elIndex, "innerHTML", i0.Δbind(ctx.attrInnerHTML), i0.ΔsanitizeHtml);
|
||||
i0.ΔelementAttribute(elIndex, "title", i0.Δbind(ctx.attrSafeTitle));
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -3228,15 +3228,15 @@ describe('ngtsc behavioral tests', () => {
|
||||
const hostBindingsFn = `
|
||||
hostBindings: function UnsafePropsDirective_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
i0.ɵallocHostVars(6);
|
||||
i0.ΔallocHostVars(6);
|
||||
}
|
||||
if (rf & 2) {
|
||||
i0.ɵelementProperty(elIndex, "href", i0.ɵbind(ctx.propHref), i0.ɵsanitizeUrlOrResourceUrl, true);
|
||||
i0.ɵelementProperty(elIndex, "src", i0.ɵbind(ctx.propSrc), i0.ɵsanitizeUrlOrResourceUrl, true);
|
||||
i0.ɵelementProperty(elIndex, "action", i0.ɵbind(ctx.propAction), i0.ɵsanitizeUrl, true);
|
||||
i0.ɵelementProperty(elIndex, "profile", i0.ɵbind(ctx.propProfile), i0.ɵsanitizeResourceUrl, true);
|
||||
i0.ɵelementProperty(elIndex, "innerHTML", i0.ɵbind(ctx.propInnerHTML), i0.ɵsanitizeHtml, true);
|
||||
i0.ɵelementProperty(elIndex, "title", i0.ɵbind(ctx.propSafeTitle), null, true);
|
||||
i0.ΔelementProperty(elIndex, "href", i0.Δbind(ctx.propHref), i0.ΔsanitizeUrlOrResourceUrl, true);
|
||||
i0.ΔelementProperty(elIndex, "src", i0.Δbind(ctx.propSrc), i0.ΔsanitizeUrlOrResourceUrl, true);
|
||||
i0.ΔelementProperty(elIndex, "action", i0.Δbind(ctx.propAction), i0.ΔsanitizeUrl, true);
|
||||
i0.ΔelementProperty(elIndex, "profile", i0.Δbind(ctx.propProfile), i0.ΔsanitizeResourceUrl, true);
|
||||
i0.ΔelementProperty(elIndex, "innerHTML", i0.Δbind(ctx.propInnerHTML), i0.ΔsanitizeHtml, true);
|
||||
i0.ΔelementProperty(elIndex, "title", i0.Δbind(ctx.propSafeTitle), null, true);
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -3268,15 +3268,15 @@ describe('ngtsc behavioral tests', () => {
|
||||
const hostBindingsFn = `
|
||||
hostBindings: function FooCmp_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
i0.ɵallocHostVars(6);
|
||||
i0.ΔallocHostVars(6);
|
||||
}
|
||||
if (rf & 2) {
|
||||
i0.ɵelementProperty(elIndex, "src", i0.ɵbind(ctx.srcProp), null, true);
|
||||
i0.ɵelementProperty(elIndex, "href", i0.ɵbind(ctx.hrefProp), null, true);
|
||||
i0.ɵelementProperty(elIndex, "title", i0.ɵbind(ctx.titleProp), null, true);
|
||||
i0.ɵelementAttribute(elIndex, "src", i0.ɵbind(ctx.srcAttr));
|
||||
i0.ɵelementAttribute(elIndex, "href", i0.ɵbind(ctx.hrefAttr));
|
||||
i0.ɵelementAttribute(elIndex, "title", i0.ɵbind(ctx.titleAttr));
|
||||
i0.ΔelementProperty(elIndex, "src", i0.Δbind(ctx.srcProp), null, true);
|
||||
i0.ΔelementProperty(elIndex, "href", i0.Δbind(ctx.hrefProp), null, true);
|
||||
i0.ΔelementProperty(elIndex, "title", i0.Δbind(ctx.titleProp), null, true);
|
||||
i0.ΔelementAttribute(elIndex, "src", i0.Δbind(ctx.srcAttr));
|
||||
i0.ΔelementAttribute(elIndex, "href", i0.Δbind(ctx.hrefAttr));
|
||||
i0.ΔelementAttribute(elIndex, "title", i0.Δbind(ctx.titleAttr));
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -3306,13 +3306,13 @@ describe('ngtsc behavioral tests', () => {
|
||||
beforeEach(() => {
|
||||
env.tsconfig();
|
||||
env.write('node_modules/@angular/router/index.d.ts', `
|
||||
import {ModuleWithProviders, ɵNgModuleDefWithMeta as NgModuleDefWithMeta} from '@angular/core';
|
||||
import {ModuleWithProviders, ΔNgModuleDefWithMeta as ΔNgModuleDefWithMeta} from '@angular/core';
|
||||
|
||||
export declare var ROUTES;
|
||||
export declare class RouterModule {
|
||||
static forRoot(arg1: any, arg2: any): ModuleWithProviders<RouterModule>;
|
||||
static forChild(arg1: any): ModuleWithProviders<RouterModule>;
|
||||
static ngModuleDef: NgModuleDefWithMeta<RouterModule, never, never, never>;
|
||||
static ngModuleDef: ΔNgModuleDefWithMeta<RouterModule, never, never, never>;
|
||||
}
|
||||
`);
|
||||
});
|
||||
@ -3942,24 +3942,24 @@ export const Foo = Foo__PRE_R3__;
|
||||
|
||||
// 'alpha' declares the directive which will ultimately be imported.
|
||||
env.write('alpha.d.ts', `
|
||||
import {ɵDirectiveDefWithMeta, ɵNgModuleDefWithMeta} from '@angular/core';
|
||||
import {ΔDirectiveDefWithMeta, ΔNgModuleDefWithMeta} from '@angular/core';
|
||||
|
||||
export declare class ExternalDir {
|
||||
static ngDirectiveDef: ɵDirectiveDefWithMeta<ExternalDir, '[test]', never, never, never, never>;
|
||||
static ngDirectiveDef: ΔDirectiveDefWithMeta<ExternalDir, '[test]', never, never, never, never>;
|
||||
}
|
||||
|
||||
export declare class AlphaModule {
|
||||
static ngModuleDef: ɵNgModuleDefWithMeta<AlphaModule, [typeof ExternalDir], never, [typeof ExternalDir]>;
|
||||
static ngModuleDef: ΔNgModuleDefWithMeta<AlphaModule, [typeof ExternalDir], never, [typeof ExternalDir]>;
|
||||
}
|
||||
`);
|
||||
|
||||
// 'beta' re-exports AlphaModule from alpha.
|
||||
env.write('beta.d.ts', `
|
||||
import {ɵNgModuleDefWithMeta} from '@angular/core';
|
||||
import {ΔNgModuleDefWithMeta} from '@angular/core';
|
||||
import {AlphaModule} from './alpha';
|
||||
|
||||
export declare class BetaModule {
|
||||
static ngModuleDef: ɵNgModuleDefWithMeta<AlphaModule, never, never, [typeof AlphaModule]>;
|
||||
static ngModuleDef: ΔNgModuleDefWithMeta<AlphaModule, never, never, [typeof AlphaModule]>;
|
||||
}
|
||||
`);
|
||||
|
||||
@ -3991,26 +3991,26 @@ export const Foo = Foo__PRE_R3__;
|
||||
it('should write alias ES2015 exports for NgModule exported directives', () => {
|
||||
env.tsconfig({'_useHostForImportGeneration': true});
|
||||
env.write('external.d.ts', `
|
||||
import {ɵDirectiveDefWithMeta, ɵNgModuleDefWithMeta} from '@angular/core';
|
||||
import {ΔDirectiveDefWithMeta, ΔNgModuleDefWithMeta} from '@angular/core';
|
||||
import {LibModule} from './lib';
|
||||
|
||||
export declare class ExternalDir {
|
||||
static ngDirectiveDef: ɵDirectiveDefWithMeta<ExternalDir, '[test]', never, never, never, never>;
|
||||
static ngDirectiveDef: ΔDirectiveDefWithMeta<ExternalDir, '[test]', never, never, never, never>;
|
||||
}
|
||||
|
||||
export declare class ExternalModule {
|
||||
static ngModuleDef: ɵNgModuleDefWithMeta<ExternalModule, [typeof ExternalDir], never, [typeof ExternalDir, typeof LibModule]>;
|
||||
static ngModuleDef: ΔNgModuleDefWithMeta<ExternalModule, [typeof ExternalDir], never, [typeof ExternalDir, typeof LibModule]>;
|
||||
}
|
||||
`);
|
||||
env.write('lib.d.ts', `
|
||||
import {ɵDirectiveDefWithMeta, ɵNgModuleDefWithMeta} from '@angular/core';
|
||||
import {ΔDirectiveDefWithMeta, ΔNgModuleDefWithMeta} from '@angular/core';
|
||||
|
||||
export declare class LibDir {
|
||||
static ngDirectiveDef: ɵDirectiveDefWithMeta<LibDir, '[lib]', never, never, never, never>;
|
||||
static ngDirectiveDef: ΔDirectiveDefWithMeta<LibDir, '[lib]', never, never, never, never>;
|
||||
}
|
||||
|
||||
export declare class LibModule {
|
||||
static ngModuleDef: ɵNgModuleDefWithMeta<LibModule, [typeof LibDir], never, [typeof LibDir]>;
|
||||
static ngModuleDef: ΔNgModuleDefWithMeta<LibModule, [typeof LibDir], never, [typeof LibDir]>;
|
||||
}
|
||||
`);
|
||||
env.write('foo.ts', `
|
||||
|
@ -25,10 +25,10 @@ describe('ngtsc module scopes', () => {
|
||||
env.tsconfig();
|
||||
env.write('test.ts', `
|
||||
import {NgModule} from '@angular/core';
|
||||
|
||||
|
||||
@NgModule({})
|
||||
export class OtherModule {}
|
||||
|
||||
|
||||
@NgModule({imports: [OtherModule]})
|
||||
export class TestModule {}
|
||||
`);
|
||||
@ -36,23 +36,23 @@ describe('ngtsc module scopes', () => {
|
||||
env.driveMain();
|
||||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('i0.ɵdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents).toContain('i0.ΔdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents)
|
||||
.toContain(
|
||||
'/*@__PURE__*/ i0.ɵsetNgModuleScope(TestModule, { imports: [OtherModule] });');
|
||||
'/*@__PURE__*/ i0.ΔsetNgModuleScope(TestModule, { imports: [OtherModule] });');
|
||||
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'static ngModuleDef: i0.ɵNgModuleDefWithMeta<TestModule, never, [typeof OtherModule], never>');
|
||||
'static ngModuleDef: i0.ΔNgModuleDefWithMeta<TestModule, never, [typeof OtherModule], never>');
|
||||
});
|
||||
|
||||
it('should produce an error when an invalid class is imported', () => {
|
||||
env.write('test.ts', `
|
||||
import {NgModule} from '@angular/core';
|
||||
|
||||
|
||||
class NotAModule {}
|
||||
|
||||
|
||||
@NgModule({imports: [NotAModule]})
|
||||
class IsAModule {}
|
||||
`);
|
||||
@ -69,7 +69,7 @@ describe('ngtsc module scopes', () => {
|
||||
env.write('test.ts', `
|
||||
import {NgModule} from '@angular/core';
|
||||
import {NotAClass} from './dep';
|
||||
|
||||
|
||||
@NgModule({imports: [NotAClass]})
|
||||
class IsAModule {}
|
||||
`);
|
||||
@ -87,10 +87,10 @@ describe('ngtsc module scopes', () => {
|
||||
env.tsconfig();
|
||||
env.write('test.ts', `
|
||||
import {NgModule} from '@angular/core';
|
||||
|
||||
|
||||
@NgModule({})
|
||||
export class OtherModule {}
|
||||
|
||||
|
||||
@NgModule({exports: [OtherModule]})
|
||||
export class TestModule {}
|
||||
`);
|
||||
@ -98,23 +98,23 @@ describe('ngtsc module scopes', () => {
|
||||
env.driveMain();
|
||||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('i0.ɵdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents).toContain('i0.ΔdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents)
|
||||
.toContain(
|
||||
'/*@__PURE__*/ i0.ɵsetNgModuleScope(TestModule, { exports: [OtherModule] });');
|
||||
'/*@__PURE__*/ i0.ΔsetNgModuleScope(TestModule, { exports: [OtherModule] });');
|
||||
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'static ngModuleDef: i0.ɵNgModuleDefWithMeta<TestModule, never, never, [typeof OtherModule]>');
|
||||
'static ngModuleDef: i0.ΔNgModuleDefWithMeta<TestModule, never, never, [typeof OtherModule]>');
|
||||
});
|
||||
|
||||
it('should produce an error when a non-NgModule class is exported', () => {
|
||||
env.write('test.ts', `
|
||||
import {NgModule} from '@angular/core';
|
||||
|
||||
|
||||
class NotAModule {}
|
||||
|
||||
|
||||
@NgModule({exports: [NotAModule]})
|
||||
class IsAModule {}
|
||||
`);
|
||||
@ -131,12 +131,12 @@ describe('ngtsc module scopes', () => {
|
||||
import {NgModule} from '@angular/core';
|
||||
|
||||
export class NotAModule {}
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [NotAModule],
|
||||
})
|
||||
class InvalidModule {}
|
||||
|
||||
|
||||
@NgModule({exports: [InvalidModule]})
|
||||
class IsAModule {}
|
||||
`);
|
||||
@ -157,10 +157,10 @@ describe('ngtsc module scopes', () => {
|
||||
it('should produce an error when a non-declared/imported class is re-exported', () => {
|
||||
env.write('test.ts', `
|
||||
import {Directive, NgModule} from '@angular/core';
|
||||
|
||||
|
||||
@Directive({selector: 'test'})
|
||||
class Dir {}
|
||||
|
||||
|
||||
@NgModule({exports: [Dir]})
|
||||
class IsAModule {}
|
||||
`);
|
||||
|
@ -23,17 +23,17 @@ describe('template source-mapping', () => {
|
||||
it('should map simple element with content', () => {
|
||||
const mappings = compileAndMap('<h1>Heading 1</h1>');
|
||||
expect(mappings).toContain(
|
||||
{source: '<h1>', generated: 'i0.ɵelementStart(0, "h1")', sourceUrl: '../test.ts'});
|
||||
{source: '<h1>', generated: 'i0.ΔelementStart(0, "h1")', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{source: 'Heading 1', generated: 'i0.ɵtext(1, "Heading 1")', sourceUrl: '../test.ts'});
|
||||
{source: 'Heading 1', generated: 'i0.Δtext(1, "Heading 1")', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{source: '</h1>', generated: 'i0.ɵelementEnd()', sourceUrl: '../test.ts'});
|
||||
{source: '</h1>', generated: 'i0.ΔelementEnd()', sourceUrl: '../test.ts'});
|
||||
});
|
||||
|
||||
it('should map void element', () => {
|
||||
const mappings = compileAndMap('<hr>');
|
||||
expect(mappings).toContain(
|
||||
{source: '<hr>', generated: 'i0.ɵelement(0, "hr")', sourceUrl: '../test.ts'});
|
||||
{source: '<hr>', generated: 'i0.Δelement(0, "hr")', sourceUrl: '../test.ts'});
|
||||
});
|
||||
});
|
||||
|
||||
@ -41,40 +41,40 @@ describe('template source-mapping', () => {
|
||||
it('should map a mix of interpolated and static content', () => {
|
||||
const mappings = compileAndMap('<h3>Hello {{ name }}</h3>');
|
||||
expect(mappings).toContain(
|
||||
{source: '<h3>', generated: 'i0.ɵelementStart(0, "h3")', sourceUrl: '../test.ts'});
|
||||
{source: '<h3>', generated: 'i0.ΔelementStart(0, "h3")', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain({
|
||||
source: 'Hello {{ name }}',
|
||||
generated: 'i0.ɵtextBinding(1, i0.ɵinterpolation1("Hello ", ctx.name, ""))',
|
||||
generated: 'i0.ΔtextBinding(1, i0.Δinterpolation1("Hello ", ctx.name, ""))',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain(
|
||||
{source: '</h3>', generated: 'i0.ɵelementEnd()', sourceUrl: '../test.ts'});
|
||||
{source: '</h3>', generated: 'i0.ΔelementEnd()', sourceUrl: '../test.ts'});
|
||||
});
|
||||
|
||||
it('should map a complex interpolated expression', () => {
|
||||
const mappings = compileAndMap('<h2>{{ greeting + " " + name }}</h2>');
|
||||
expect(mappings).toContain(
|
||||
{source: '<h2>', generated: 'i0.ɵelementStart(0, "h2")', sourceUrl: '../test.ts'});
|
||||
{source: '<h2>', generated: 'i0.ΔelementStart(0, "h2")', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain({
|
||||
source: '{{ greeting + " " + name }}',
|
||||
generated:
|
||||
'i0.ɵtextBinding(1, i0.ɵinterpolation1("", ((ctx.greeting + " ") + ctx.name), ""))',
|
||||
'i0.ΔtextBinding(1, i0.Δinterpolation1("", ((ctx.greeting + " ") + ctx.name), ""))',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain(
|
||||
{source: '</h2>', generated: 'i0.ɵelementEnd()', sourceUrl: '../test.ts'});
|
||||
{source: '</h2>', generated: 'i0.ΔelementEnd()', sourceUrl: '../test.ts'});
|
||||
});
|
||||
|
||||
it('should map interpolated properties', () => {
|
||||
const mappings = compileAndMap('<div id="{{name}}"></div>');
|
||||
expect(mappings).toContain({
|
||||
source: '<div id="{{name}}"></div>',
|
||||
generated: 'i0.ɵelement(0, "div", _c0)',
|
||||
generated: 'i0.Δelement(0, "div", _c0)',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain({
|
||||
source: 'id="{{name}}"',
|
||||
generated: 'i0.ɵelementProperty(0, "id", i0.ɵinterpolation1("", ctx.name, ""))',
|
||||
generated: 'i0.ΔelementProperty(0, "id", i0.Δinterpolation1("", ctx.name, ""))',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
});
|
||||
@ -82,15 +82,15 @@ describe('template source-mapping', () => {
|
||||
it('should map interpolation with pipe', () => {
|
||||
const mappings = compileAndMap('<div>{{200.3 | percent : 2 }}</div>');
|
||||
expect(mappings).toContain(
|
||||
{source: '<div>', generated: 'i0.ɵelementStart(0, "div")', sourceUrl: '../test.ts'});
|
||||
{source: '<div>', generated: 'i0.ΔelementStart(0, "div")', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain({
|
||||
source: '{{200.3 | percent : 2 }}',
|
||||
generated:
|
||||
'i0.ɵtextBinding(1, i0.ɵinterpolation1("", i0.ɵpipeBind2(2, 1, 200.3, 2), ""))',
|
||||
'i0.ΔtextBinding(1, i0.Δinterpolation1("", i0.ΔpipeBind2(2, 1, 200.3, 2), ""))',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain(
|
||||
{source: '</div>', generated: 'i0.ɵelementEnd()', sourceUrl: '../test.ts'});
|
||||
{source: '</div>', generated: 'i0.ΔelementEnd()', sourceUrl: '../test.ts'});
|
||||
});
|
||||
});
|
||||
|
||||
@ -99,12 +99,12 @@ describe('template source-mapping', () => {
|
||||
const mappings = compileAndMap('<div [attr]="name"></div>');
|
||||
expect(mappings).toContain({
|
||||
source: '<div [attr]="name"></div>',
|
||||
generated: 'i0.ɵelement(0, "div", _c0)',
|
||||
generated: 'i0.Δelement(0, "div", _c0)',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain({
|
||||
source: '[attr]="name"',
|
||||
generated: 'i0.ɵelementProperty(0, "attr", i0.ɵbind(ctx.name))',
|
||||
generated: 'i0.ΔelementProperty(0, "attr", i0.Δbind(ctx.name))',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
});
|
||||
@ -113,12 +113,12 @@ describe('template source-mapping', () => {
|
||||
const mappings = compileAndMap('<div [attr]="greeting + name"></div>');
|
||||
expect(mappings).toContain({
|
||||
source: '<div [attr]="greeting + name"></div>',
|
||||
generated: 'i0.ɵelement(0, "div", _c0)',
|
||||
generated: 'i0.Δelement(0, "div", _c0)',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain({
|
||||
source: '[attr]="greeting + name"',
|
||||
generated: 'i0.ɵelementProperty(0, "attr", i0.ɵbind((ctx.greeting + ctx.name)))',
|
||||
generated: 'i0.ΔelementProperty(0, "attr", i0.Δbind((ctx.greeting + ctx.name)))',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
});
|
||||
@ -127,12 +127,12 @@ describe('template source-mapping', () => {
|
||||
const mappings = compileAndMap('<div bind-attr="name"></div>');
|
||||
expect(mappings).toContain({
|
||||
source: '<div bind-attr="name"></div>',
|
||||
generated: 'i0.ɵelement(0, "div", _c0)',
|
||||
generated: 'i0.Δelement(0, "div", _c0)',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain({
|
||||
source: 'bind-attr="name"',
|
||||
generated: 'i0.ɵelementProperty(0, "attr", i0.ɵbind(ctx.name))',
|
||||
generated: 'i0.ΔelementProperty(0, "attr", i0.Δbind(ctx.name))',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
});
|
||||
@ -141,15 +141,15 @@ describe('template source-mapping', () => {
|
||||
const mappings = compileAndMap('<button (click)="doSomething()">Do it</button>');
|
||||
expect(mappings).toContain({
|
||||
source: '<button (click)="doSomething()">',
|
||||
generated: 'i0.ɵelementStart(0, "button", _c0)',
|
||||
generated: 'i0.ΔelementStart(0, "button", _c0)',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain(
|
||||
{source: 'Do it', generated: 'i0.ɵtext(1, "Do it")', sourceUrl: '../test.ts'});
|
||||
{source: 'Do it', generated: 'i0.Δtext(1, "Do it")', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{source: 'doSomething()', generated: 'ctx.doSomething()', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{source: '</button>', generated: 'i0.ɵelementEnd()', sourceUrl: '../test.ts'});
|
||||
{source: '</button>', generated: 'i0.ΔelementEnd()', sourceUrl: '../test.ts'});
|
||||
});
|
||||
|
||||
it('should map a complex output binding expression', () => {
|
||||
@ -157,11 +157,11 @@ describe('template source-mapping', () => {
|
||||
compileAndMap(`<button (click)="items.push('item' + items.length)">Add Item</button>`);
|
||||
expect(mappings).toContain({
|
||||
source: `<button (click)="items.push('item' + items.length)">`,
|
||||
generated: 'i0.ɵelementStart(0, "button", _c0)',
|
||||
generated: 'i0.ΔelementStart(0, "button", _c0)',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain(
|
||||
{source: 'Add Item', generated: 'i0.ɵtext(1, "Add Item")', sourceUrl: '../test.ts'});
|
||||
{source: 'Add Item', generated: 'i0.Δtext(1, "Add Item")', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{source: 'items.push(', generated: 'ctx.items.push((', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
@ -172,41 +172,41 @@ describe('template source-mapping', () => {
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain(
|
||||
{source: '</button>', generated: 'i0.ɵelementEnd()', sourceUrl: '../test.ts'});
|
||||
{source: '</button>', generated: 'i0.ΔelementEnd()', sourceUrl: '../test.ts'});
|
||||
});
|
||||
|
||||
it('should map a longhand output binding expression', () => {
|
||||
const mappings = compileAndMap('<button on-click="doSomething()">Do it</button>');
|
||||
expect(mappings).toContain({
|
||||
source: '<button on-click="doSomething()">',
|
||||
generated: 'i0.ɵelementStart(0, "button", _c0)',
|
||||
generated: 'i0.ΔelementStart(0, "button", _c0)',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain(
|
||||
{source: 'Do it', generated: 'i0.ɵtext(1, "Do it")', sourceUrl: '../test.ts'});
|
||||
{source: 'Do it', generated: 'i0.Δtext(1, "Do it")', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{source: 'doSomething()', generated: 'ctx.doSomething()', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{source: '</button>', generated: 'i0.ɵelementEnd()', sourceUrl: '../test.ts'});
|
||||
{source: '</button>', generated: 'i0.ΔelementEnd()', sourceUrl: '../test.ts'});
|
||||
});
|
||||
|
||||
it('should map a two-way binding expression', () => {
|
||||
const mappings = compileAndMap('Name: <input [(ngModel)]="name">');
|
||||
expect(mappings).toContain({
|
||||
source: '<input [(ngModel)]="name">',
|
||||
generated: 'i0.ɵelementStart(1, "input", _c0)',
|
||||
generated: 'i0.ΔelementStart(1, "input", _c0)',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
// TODO: improve mappings here
|
||||
expect(mappings).toContain({
|
||||
source: '[(ngModel)]="name"',
|
||||
generated:
|
||||
'i0.ɵlistener("ngModelChange", function TestCmp_Template_input_ngModelChange_1_listener($event) { return ctx.name = $event; })',
|
||||
'i0.Δlistener("ngModelChange", function TestCmp_Template_input_ngModelChange_1_listener($event) { return ctx.name = $event; })',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain({
|
||||
source: '<input [(ngModel)]="name">',
|
||||
generated: 'i0.ɵelementEnd()',
|
||||
generated: 'i0.ΔelementEnd()',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
});
|
||||
@ -215,19 +215,19 @@ describe('template source-mapping', () => {
|
||||
const mappings = compileAndMap('Name: <input bindon-ngModel="name">');
|
||||
expect(mappings).toContain({
|
||||
source: '<input bindon-ngModel="name">',
|
||||
generated: 'i0.ɵelementStart(1, "input", _c0)',
|
||||
generated: 'i0.ΔelementStart(1, "input", _c0)',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
// TODO: improve mappings here
|
||||
expect(mappings).toContain({
|
||||
source: 'bindon-ngModel="name"',
|
||||
generated:
|
||||
'i0.ɵlistener("ngModelChange", function TestCmp_Template_input_ngModelChange_1_listener($event) { return ctx.name = $event; })',
|
||||
'i0.Δlistener("ngModelChange", function TestCmp_Template_input_ngModelChange_1_listener($event) { return ctx.name = $event; })',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain({
|
||||
source: '<input bindon-ngModel="name">',
|
||||
generated: 'i0.ɵelementEnd()',
|
||||
generated: 'i0.ΔelementEnd()',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
});
|
||||
@ -236,17 +236,17 @@ describe('template source-mapping', () => {
|
||||
const mappings = compileAndMap('<div [class.initial]="isInitial">Message</div>');
|
||||
expect(mappings).toContain({
|
||||
source: '<div [class.initial]="isInitial">',
|
||||
generated: 'i0.ɵelementStart(0, "div")',
|
||||
generated: 'i0.ΔelementStart(0, "div")',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
|
||||
// TODO: Add better mappings for binding
|
||||
|
||||
expect(mappings).toContain(
|
||||
{source: 'Message', generated: 'i0.ɵtext(1, "Message")', sourceUrl: '../test.ts'});
|
||||
{source: 'Message', generated: 'i0.Δtext(1, "Message")', sourceUrl: '../test.ts'});
|
||||
|
||||
expect(mappings).toContain(
|
||||
{source: '</div>', generated: 'i0.ɵelementEnd()', sourceUrl: '../test.ts'});
|
||||
{source: '</div>', generated: 'i0.ΔelementEnd()', sourceUrl: '../test.ts'});
|
||||
});
|
||||
});
|
||||
|
||||
@ -256,20 +256,20 @@ describe('template source-mapping', () => {
|
||||
|
||||
expect(mappings).toContain({
|
||||
source: '<div *ngIf="showMessage()">',
|
||||
generated: 'i0.ɵelementStart(0, "div")',
|
||||
generated: 'i0.ΔelementStart(0, "div")',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
|
||||
// TODO - map the bindings better
|
||||
|
||||
expect(mappings).toContain(
|
||||
{source: '</div>', generated: 'i0.ɵelementEnd()', sourceUrl: '../test.ts'});
|
||||
{source: '</div>', generated: 'i0.ΔelementEnd()', sourceUrl: '../test.ts'});
|
||||
|
||||
// TODO: the `ctx_r...` appears to be dependent upon previous tests!!!
|
||||
|
||||
// expect(mappings).toContain({
|
||||
// source: '{{ name }}',
|
||||
// generated: 'i0.ɵtextBinding(1, i0.ɵinterpolation1("", ctx_r0.name, ""))',
|
||||
// generated: 'i0.ΔtextBinding(1, i0.Δinterpolation1("", ctx_r0.name, ""))',
|
||||
// sourceUrl: '../test.ts'
|
||||
// });
|
||||
});
|
||||
@ -282,18 +282,18 @@ describe('template source-mapping', () => {
|
||||
`</ng-template>`);
|
||||
|
||||
expect(mappings).toContain(
|
||||
{source: '<div>', generated: 'i0.ɵelementStart(0, "div")', sourceUrl: '../test.ts'});
|
||||
{source: '<div>', generated: 'i0.ΔelementStart(0, "div")', sourceUrl: '../test.ts'});
|
||||
|
||||
// TODO - map the bindings better
|
||||
|
||||
expect(mappings).toContain(
|
||||
{source: '</div>', generated: 'i0.ɵelementEnd()', sourceUrl: '../test.ts'});
|
||||
{source: '</div>', generated: 'i0.ΔelementEnd()', sourceUrl: '../test.ts'});
|
||||
|
||||
// TODO: the `ctx_r...` appears to be dependent upon previous tests!!!
|
||||
|
||||
// expect(mappings).toContain({
|
||||
// source: '{{ name }}',
|
||||
// generated: 'i0.ɵtextBinding(1, i0.ɵinterpolation1("", ctx_r0.name, ""))',
|
||||
// generated: 'i0.ΔtextBinding(1, i0.Δinterpolation1("", ctx_r0.name, ""))',
|
||||
// sourceUrl: '../test.ts'
|
||||
// });
|
||||
});
|
||||
@ -304,14 +304,14 @@ describe('template source-mapping', () => {
|
||||
|
||||
expect(mappings).toContain({
|
||||
source: '<div *ngFor="let item of items; index as i; trackBy: trackByFn">',
|
||||
generated: 'i0.ɵelementStart(0, "div")',
|
||||
generated: 'i0.ΔelementStart(0, "div")',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
|
||||
// TODO - map the bindings better
|
||||
|
||||
expect(mappings).toContain(
|
||||
{source: '</div>', generated: 'i0.ɵelementEnd()', sourceUrl: '../test.ts'});
|
||||
{source: '</div>', generated: 'i0.ΔelementEnd()', sourceUrl: '../test.ts'});
|
||||
|
||||
});
|
||||
|
||||
@ -330,20 +330,20 @@ describe('template source-mapping', () => {
|
||||
`<div><ng-content></ng-content></div>`);
|
||||
|
||||
expect(mappings).toContain(
|
||||
{source: '<h3>', generated: 'i0.ɵelementStart(0, "h3")', sourceUrl: '../test.ts'});
|
||||
{source: '<h3>', generated: 'i0.ΔelementStart(0, "h3")', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain({
|
||||
source: '<ng-content select="title">',
|
||||
generated: 'i0.ɵprojection(1, 1)',
|
||||
generated: 'i0.Δprojection(1, 1)',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain(
|
||||
{source: '</h3>', generated: 'i0.ɵelementEnd()', sourceUrl: '../test.ts'});
|
||||
{source: '</h3>', generated: 'i0.ΔelementEnd()', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{source: '<div>', generated: 'i0.ɵelementStart(2, "div")', sourceUrl: '../test.ts'});
|
||||
{source: '<div>', generated: 'i0.ΔelementStart(2, "div")', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{source: '<ng-content>', generated: 'i0.ɵprojection(3)', sourceUrl: '../test.ts'});
|
||||
{source: '<ng-content>', generated: 'i0.Δprojection(3)', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{source: '</div>', generated: 'i0.ɵelementEnd()', sourceUrl: '../test.ts'});
|
||||
{source: '</div>', generated: 'i0.ΔelementEnd()', sourceUrl: '../test.ts'});
|
||||
});
|
||||
});
|
||||
|
||||
@ -352,24 +352,24 @@ describe('template source-mapping', () => {
|
||||
|
||||
// Creation mode
|
||||
expect(mappings).toContain(
|
||||
{generated: 'i0.ɵelementStart(0, "div")', source: '<div>', sourceUrl: '../test.ts'});
|
||||
{generated: 'i0.ΔelementStart(0, "div")', source: '<div>', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵtext(1, "this is a test")',
|
||||
generated: 'i0.Δtext(1, "this is a test")',
|
||||
source: 'this is a test',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain(
|
||||
{generated: 'i0.ɵelementEnd()', source: '</div>', sourceUrl: '../test.ts'});
|
||||
{generated: 'i0.ΔelementEnd()', source: '</div>', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{generated: 'i0.ɵelementStart(2, "div")', source: '<div>', sourceUrl: '../test.ts'});
|
||||
{generated: 'i0.ΔelementStart(2, "div")', source: '<div>', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{generated: 'i0.ɵtext(3)', source: '{{ 1 + 2 }}', sourceUrl: '../test.ts'});
|
||||
{generated: 'i0.Δtext(3)', source: '{{ 1 + 2 }}', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{generated: 'i0.ɵelementEnd()', source: '</div>', sourceUrl: '../test.ts'});
|
||||
{generated: 'i0.ΔelementEnd()', source: '</div>', sourceUrl: '../test.ts'});
|
||||
|
||||
// Update mode
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵtextBinding(3, i0.ɵinterpolation1("", (1 + 2), ""))',
|
||||
generated: 'i0.ΔtextBinding(3, i0.Δinterpolation1("", (1 + 2), ""))',
|
||||
source: '{{ 1 + 2 }}',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
@ -380,24 +380,24 @@ describe('template source-mapping', () => {
|
||||
|
||||
// Creation mode
|
||||
expect(mappings).toContain(
|
||||
{generated: 'i0.ɵelementStart(0, "div")', source: '<div>', sourceUrl: '../test.ts'});
|
||||
{generated: 'i0.ΔelementStart(0, "div")', source: '<div>', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵtext(1, "this is a test")',
|
||||
generated: 'i0.Δtext(1, "this is a test")',
|
||||
source: 'this is a test',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain(
|
||||
{generated: 'i0.ɵelementEnd()', source: '</div>', sourceUrl: '../test.ts'});
|
||||
{generated: 'i0.ΔelementEnd()', source: '</div>', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{generated: 'i0.ɵelementStart(2, "div")', source: '<div>', sourceUrl: '../test.ts'});
|
||||
{generated: 'i0.ΔelementStart(2, "div")', source: '<div>', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{generated: 'i0.ɵtext(3)', source: '{{ 1 + 2 }}', sourceUrl: '../test.ts'});
|
||||
{generated: 'i0.Δtext(3)', source: '{{ 1 + 2 }}', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain(
|
||||
{generated: 'i0.ɵelementEnd()', source: '</div>', sourceUrl: '../test.ts'});
|
||||
{generated: 'i0.ΔelementEnd()', source: '</div>', sourceUrl: '../test.ts'});
|
||||
|
||||
// Update mode
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵtextBinding(3, i0.ɵinterpolation1("", (1 + 2), ""))',
|
||||
generated: 'i0.ΔtextBinding(3, i0.Δinterpolation1("", (1 + 2), ""))',
|
||||
source: '{{ 1 + 2 }}',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
@ -409,7 +409,7 @@ describe('template source-mapping', () => {
|
||||
const mappings = compileAndMap('<div class=\\"some-class\\">this is a test</div>');
|
||||
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵelementStart(0, "div", _c0)',
|
||||
generated: 'i0.ΔelementStart(0, "div", _c0)',
|
||||
source: '<div class=\\"some-class\\">',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
@ -428,30 +428,30 @@ describe('template source-mapping', () => {
|
||||
|
||||
// Creation mode
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵelementStart(0, "div")',
|
||||
generated: 'i0.ΔelementStart(0, "div")',
|
||||
source: '<div>',
|
||||
sourceUrl: '../dir/test.html'
|
||||
});
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵtext(1, "this is a test")',
|
||||
generated: 'i0.Δtext(1, "this is a test")',
|
||||
source: 'this is a test',
|
||||
sourceUrl: '../dir/test.html'
|
||||
});
|
||||
expect(mappings).toContain(
|
||||
{generated: 'i0.ɵelementEnd()', source: '</div>', sourceUrl: '../dir/test.html'});
|
||||
{generated: 'i0.ΔelementEnd()', source: '</div>', sourceUrl: '../dir/test.html'});
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵelementStart(2, "div")',
|
||||
generated: 'i0.ΔelementStart(2, "div")',
|
||||
source: '<div>',
|
||||
sourceUrl: '../dir/test.html'
|
||||
});
|
||||
expect(mappings).toContain(
|
||||
{generated: 'i0.ɵtext(3)', source: '{{ 1 + 2 }}', sourceUrl: '../dir/test.html'});
|
||||
{generated: 'i0.Δtext(3)', source: '{{ 1 + 2 }}', sourceUrl: '../dir/test.html'});
|
||||
expect(mappings).toContain(
|
||||
{generated: 'i0.ɵelementEnd()', source: '</div>', sourceUrl: '../dir/test.html'});
|
||||
{generated: 'i0.ΔelementEnd()', source: '</div>', sourceUrl: '../dir/test.html'});
|
||||
|
||||
// Update mode
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵtextBinding(3, i0.ɵinterpolation1("", (1 + 2), ""))',
|
||||
generated: 'i0.ΔtextBinding(3, i0.Δinterpolation1("", (1 + 2), ""))',
|
||||
source: '{{ 1 + 2 }}',
|
||||
sourceUrl: '../dir/test.html'
|
||||
});
|
||||
@ -463,39 +463,39 @@ describe('template source-mapping', () => {
|
||||
|
||||
// Creation mode
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵelementStart(0, "div")',
|
||||
generated: 'i0.ΔelementStart(0, "div")',
|
||||
source: '<div>',
|
||||
sourceUrl: '../extraRootDir/test.html'
|
||||
});
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵtext(1, "this is a test")',
|
||||
generated: 'i0.Δtext(1, "this is a test")',
|
||||
source: 'this is a test',
|
||||
sourceUrl: '../extraRootDir/test.html'
|
||||
});
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵelementEnd()',
|
||||
generated: 'i0.ΔelementEnd()',
|
||||
source: '</div>',
|
||||
sourceUrl: '../extraRootDir/test.html'
|
||||
});
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵelementStart(2, "div")',
|
||||
generated: 'i0.ΔelementStart(2, "div")',
|
||||
source: '<div>',
|
||||
sourceUrl: '../extraRootDir/test.html'
|
||||
});
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵtext(3)',
|
||||
generated: 'i0.Δtext(3)',
|
||||
source: '{{ 1 + 2 }}',
|
||||
sourceUrl: '../extraRootDir/test.html'
|
||||
});
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵelementEnd()',
|
||||
generated: 'i0.ΔelementEnd()',
|
||||
source: '</div>',
|
||||
sourceUrl: '../extraRootDir/test.html'
|
||||
});
|
||||
|
||||
// Update mode
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵtextBinding(3, i0.ɵinterpolation1("", (1 + 2), ""))',
|
||||
generated: 'i0.ΔtextBinding(3, i0.Δinterpolation1("", (1 + 2), ""))',
|
||||
source: '{{ 1 + 2 }}',
|
||||
sourceUrl: '../extraRootDir/test.html'
|
||||
});
|
||||
|
@ -26,17 +26,17 @@ export declare class NgForOfContext<T> {
|
||||
export declare class NgForOf<T> {
|
||||
ngForOf: T[];
|
||||
static ngTemplateContextGuard<T>(dir: NgForOf<T>, ctx: any): ctx is NgForOfContext<T>;
|
||||
static ngDirectiveDef: i0.ɵDirectiveDefWithMeta<NgForOf<any>, '[ngFor][ngForOf]', never, {'ngForOf': 'ngForOf'}, {}, never>;
|
||||
static ngDirectiveDef: i0.ΔDirectiveDefWithMeta<NgForOf<any>, '[ngFor][ngForOf]', never, {'ngForOf': 'ngForOf'}, {}, never>;
|
||||
}
|
||||
|
||||
export declare class NgIf {
|
||||
ngIf: any;
|
||||
static ngTemplateGuard_ngIf<E>(dir: NgIf, expr: E): expr is NonNullable<E>
|
||||
static ngDirectiveDef: i0.ɵDirectiveDefWithMeta<NgForOf<any>, '[ngIf]', never, {'ngIf': 'ngIf'}, {}, never>;
|
||||
static ngDirectiveDef: i0.ΔDirectiveDefWithMeta<NgForOf<any>, '[ngIf]', never, {'ngIf': 'ngIf'}, {}, never>;
|
||||
}
|
||||
|
||||
export declare class CommonModule {
|
||||
static ngModuleDef: i0.ɵNgModuleDefWithMeta<CommonModule, [typeof NgIf, typeof NgForOf], never, [typeof NgIf, typeof NgForOf]>;
|
||||
static ngModuleDef: i0.ΔNgModuleDefWithMeta<CommonModule, [typeof NgIf, typeof NgForOf], never, [typeof NgIf, typeof NgForOf]>;
|
||||
}
|
||||
`);
|
||||
}
|
||||
|
Reference in New Issue
Block a user