Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -818,3 +818,135 @@ export declare class TestCmp {
static ɵcmp: i0.ɵɵComponentDeclaration<TestCmp, "test-cmp", never, {}, {}, never, never, true, never>;
}

/****************************************************************************************************
* PARTIAL FILE: change_detection.js
****************************************************************************************************/
import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';
import * as i0 from "@angular/core";
export class OnPushComponent {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: OnPushComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "0.0.0-PLACEHOLDER", type: OnPushComponent, isStandalone: true, selector: "on-push", ngImport: i0, template: '<div>hello</div>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom, preserveWhitespaces: true });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: OnPushComponent, decorators: [{
type: Component,
args: [{
selector: 'on-push',
template: '<div>hello</div>',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.ShadowDom,
preserveWhitespaces: true,
}]
}] });

/****************************************************************************************************
* PARTIAL FILE: change_detection.d.ts
****************************************************************************************************/
import * as i0 from "@angular/core";
export declare class OnPushComponent {
static ɵfac: i0.ɵɵFactoryDeclaration<OnPushComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<OnPushComponent, "on-push", never, {}, {}, never, never, true, never>;
}

/****************************************************************************************************
* PARTIAL FILE: export_as_query.js
****************************************************************************************************/
import { Component, Directive, ViewChild } from '@angular/core';
import * as i0 from "@angular/core";
export class FooDirective {
open() { }
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: FooDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "0.0.0-PLACEHOLDER", type: FooDirective, isStandalone: true, selector: "[foo]", exportAs: ["foo"], ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: FooDirective, decorators: [{
type: Directive,
args: [{
selector: '[foo]',
exportAs: 'foo',
}]
}] });
export class AppComponent {
ref;
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: AppComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "0.0.0-PLACEHOLDER", type: AppComponent, isStandalone: true, selector: "app-root", viewQueries: [{ propertyName: "ref", first: true, predicate: ["ref"], descendants: true }], ngImport: i0, template: '<div foo #ref="foo"></div>', isInline: true, dependencies: [{ kind: "directive", type: FooDirective, selector: "[foo]", exportAs: ["foo"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: AppComponent, decorators: [{
type: Component,
args: [{
selector: 'app-root',
imports: [FooDirective],
template: '<div foo #ref="foo"></div>',
}]
}], propDecorators: { ref: [{
type: ViewChild,
args: ['ref']
}] } });

/****************************************************************************************************
* PARTIAL FILE: export_as_query.d.ts
****************************************************************************************************/
import * as i0 from "@angular/core";
export declare class FooDirective {
open(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<FooDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<FooDirective, "[foo]", ["foo"], {}, {}, never, never, true, never>;
}
export declare class AppComponent {
ref?: FooDirective;
static ɵfac: i0.ɵɵFactoryDeclaration<AppComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AppComponent, "app-root", never, {}, {}, never, never, true, never>;
}

/****************************************************************************************************
* PARTIAL FILE: cross_file_inheritance_base.js
****************************************************************************************************/
import { Directive, Input } from '@angular/core';
import * as i0 from "@angular/core";
export class BaseDirective {
value = '';
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: BaseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "0.0.0-PLACEHOLDER", type: BaseDirective, isStandalone: true, inputs: { value: "value" }, ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: BaseDirective, decorators: [{
type: Directive
}], propDecorators: { value: [{
type: Input
}] } });

/****************************************************************************************************
* PARTIAL FILE: cross_file_inheritance_base.d.ts
****************************************************************************************************/
import * as i0 from "@angular/core";
export declare class BaseDirective {
value: string;
static ɵfac: i0.ɵɵFactoryDeclaration<BaseDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseDirective, never, never, { "value": { "alias": "value"; "required": false; }; }, {}, never, never, true, never>;
}

/****************************************************************************************************
* PARTIAL FILE: cross_file_inheritance.js
****************************************************************************************************/
import { Directive } from '@angular/core';
import { BaseDirective } from './cross_file_inheritance_base';
import * as i0 from "@angular/core";
export class ChildDirective extends BaseDirective {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ChildDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "0.0.0-PLACEHOLDER", type: ChildDirective, isStandalone: false, selector: "[child]", usesInheritance: true, ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ChildDirective, decorators: [{
type: Directive,
args: [{
selector: '[child]',
standalone: false,
}]
}] });

/****************************************************************************************************
* PARTIAL FILE: cross_file_inheritance.d.ts
****************************************************************************************************/
import { BaseDirective } from './cross_file_inheritance_base';
import * as i0 from "@angular/core";
export declare class ChildDirective extends BaseDirective {
static ɵfac: i0.ɵɵFactoryDeclaration<ChildDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<ChildDirective, "[child]", never, {}, {}, never, never, false, never>;
}

Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,39 @@
}
],
"compilationModeFilter": ["full compile", "instruction compile"]
},
{
"description": "should omit the default `OnPush` change detection in full mode, keep it in local mode, and emit `ShadowDom` encapsulation",
"inputFiles": ["change_detection.ts"],
"expectations": [
{
"failureMessage": "Invalid change detection / encapsulation metadata",
"files": ["change_detection.js"]
}
],
"compilationModeFilter": ["full compile", "local compile"]
},
{
"description": "should read a directive through a view query on a template reference bound via `exportAs`",
"inputFiles": ["export_as_query.ts"],
"expectations": [
{
"failureMessage": "Invalid exportAs / template-ref query",
"files": ["export_as_query.js"]
}
],
"compilationModeFilter": ["full compile"]
},
{
"description": "should inherit the definition and factory for a directive that extends a base directive in another file",
"inputFiles": ["cross_file_inheritance.ts", "cross_file_inheritance_base.ts"],
"expectations": [
{
"failureMessage": "Invalid cross-file inheritance",
"files": ["cross_file_inheritance.js"]
}
],
"compilationModeFilter": ["full compile", "local compile"]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export class OnPushComponent {
static ɵfac = function OnPushComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OnPushComponent)(); };
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: OnPushComponent, selectors: [["on-push"]], … encapsulation: 3 });
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export class OnPushComponent {
static ɵfac = function OnPushComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OnPushComponent)(); };
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: OnPushComponent, selectors: [["on-push"]], … encapsulation: 3, changeDetection: ChangeDetectionStrategy.OnPush });
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core';

@Component({
selector: 'on-push',
template: '<div>hello</div>',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.ShadowDom,
preserveWhitespaces: true,
})
export class OnPushComponent {}
Original file line number Diff line number Diff line change
Expand Up @@ -529,3 +529,61 @@ export declare class TestComponent {
static ɵcmp: i0.ɵɵComponentDeclaration<TestComponent, "test", never, {}, {}, never, ["basic", "*", "footer", "structural"], true, never>;
}

/****************************************************************************************************
* PARTIAL FILE: ng_project_as_multi_slot.js
****************************************************************************************************/
import { Component } from '@angular/core';
import * as i0 from "@angular/core";
export class CardComponent {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "0.0.0-PLACEHOLDER", type: CardComponent, isStandalone: true, selector: "card-cmp", ngImport: i0, template: `
<div class="header"><ng-content select="[card-title]" /></div>
<div class="body"><ng-content /></div>
`, isInline: true });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: CardComponent, decorators: [{
type: Component,
args: [{
selector: 'card-cmp',
template: `
<div class="header"><ng-content select="[card-title]" /></div>
<div class="body"><ng-content /></div>
`,
}]
}] });
export class AppComponent {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: AppComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "0.0.0-PLACEHOLDER", type: AppComponent, isStandalone: true, selector: "app-root", ngImport: i0, template: `
<card-cmp>
<h1 ngProjectAs="[card-title]">Title</h1>
<p>Body</p>
</card-cmp>
`, isInline: true, dependencies: [{ kind: "component", type: CardComponent, selector: "card-cmp" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: AppComponent, decorators: [{
type: Component,
args: [{
selector: 'app-root',
imports: [CardComponent],
template: `
<card-cmp>
<h1 ngProjectAs="[card-title]">Title</h1>
<p>Body</p>
</card-cmp>
`,
}]
}] });

/****************************************************************************************************
* PARTIAL FILE: ng_project_as_multi_slot.d.ts
****************************************************************************************************/
import * as i0 from "@angular/core";
export declare class CardComponent {
static ɵfac: i0.ɵɵFactoryDeclaration<CardComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<CardComponent, "card-cmp", never, {}, {}, never, ["[card-title]", "*"], true, never>;
}
export declare class AppComponent {
static ɵfac: i0.ɵɵFactoryDeclaration<AppComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AppComponent, "app-root", never, {}, {}, never, never, true, never>;
}

Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,17 @@
]
}
]
},
{
"description": "should support multi-slot content projection with an ngProjectAs attribute",
"inputFiles": ["ng_project_as_multi_slot.ts"],
"expectations": [
{
"failureMessage": "Invalid content projection",
"files": ["ng_project_as_multi_slot.js"]
}
],
"compilationModeFilter": ["full compile"]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const $c0$ = [[["", "card-title", ""]], "*"];
i0.ɵɵprojectionDef($c0$);
i0.ɵɵprojection(1);
i0.ɵɵprojection(3, 1);
export class AppComponent {
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AppComponent, selectors: [["app-root"]], decls: 5, vars: 0, consts: [["ngProjectAs", "[card-title]", 5, ["", "card-title", ""]]], … });
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {Component} from '@angular/core';

@Component({
selector: 'card-cmp',
template: `
<div class="header"><ng-content select="[card-title]" /></div>
<div class="body"><ng-content /></div>
`,
})
export class CardComponent {}

@Component({
selector: 'app-root',
imports: [CardComponent],
template: `
<card-cmp>
<h1 ngProjectAs="[card-title]">Title</h1>
<p>Body</p>
</card-cmp>
`,
})
export class AppComponent {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export class ChildDirective extends BaseDirective {
static ɵfac = /*@__PURE__*/ (() => { let ɵChildDirective_BaseFactory; return function ChildDirective_Factory(__ngFactoryType__) { return (ɵChildDirective_BaseFactory || (ɵChildDirective_BaseFactory = i0.ɵɵgetInheritedFactory(ChildDirective)))(__ngFactoryType__ || ChildDirective); }; })();
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: ChildDirective, selectors: [["", "child", ""]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature] });
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export class ChildDirective extends BaseDirective {
static ɵfac = /*@__PURE__*/ (() => { let ɵChildDirective_BaseFactory; return function ChildDirective_Factory(__ngFactoryType__) { return (ɵChildDirective_BaseFactory || (ɵChildDirective_BaseFactory = i0.ɵɵgetInheritedFactory(ChildDirective)))(__ngFactoryType__ || ChildDirective); }; })();
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: ChildDirective, selectors: [["", "child", ""]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature] });
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {Directive} from '@angular/core';

import {BaseDirective} from './cross_file_inheritance_base';

@Directive({
selector: '[child]',
standalone: false,
})
export class ChildDirective extends BaseDirective {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {Directive, Input} from '@angular/core';

@Directive()
export class BaseDirective {
@Input() value = '';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const $c0$ = ["ref"];
export class FooDirective {
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: FooDirective, selectors: [["", "foo", ""]], exportAs: ["foo"] });
}
export class AppComponent {
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AppComponent, selectors: [["app-root"]], viewQuery: function AppComponent_Query(rf, ctx) {
if (rf & 1) {
i0.ɵɵviewQuery($c0$, 5);
}
if (rf & 2) {
let $t$;
i0.ɵɵqueryRefresh($t$ = i0.ɵɵloadQuery()) && (ctx.ref = $t$.first);
}
}, … dependencies: [FooDirective], encapsulation: 2 });
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {Component, Directive, ViewChild} from '@angular/core';

@Directive({
selector: '[foo]',
exportAs: 'foo',
})
export class FooDirective {
open() {}
}

@Component({
selector: 'app-root',
imports: [FooDirective],
template: '<div foo #ref="foo"></div>',
})
export class AppComponent {
@ViewChild('ref') ref?: FooDirective;
}
Loading
Loading