_id stringlengths 21 254 | text stringlengths 1 93.7k | metadata dict |
|---|---|---|
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/ng_template_interpolated_prop_template.js_0_278 | consts: [[__AttributeMarker.Bindings__, "dir"]],
template: function TestComp_Template(rf, ctx) {
if (rf & 1) {
$i0$.ɵɵtemplate(0, $TestComp_ng_template_0_Template$, 0, 0, "ng-template", 0);
}
if (rf & 2) {
$i0$.ɵɵpropertyInterpolate("dir", ctx.message);
}
}
| {
"end_byte": 278,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/ng_template_interpolated_prop_template.js"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/template_context_skip.ts_0_450 | import {Component, NgModule} from '@angular/core';
@Component({
selector: 'my-component',
template: `
<div *ngFor="let outer of items">
<div *ngFor="let middle of outer.items">
<div *ngFor="let inner of middle.items">
{{ middle.value }} - {{ name }}
</div>
</div>
<... | {
"end_byte": 450,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/template_context_skip.ts"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/attr_binding_on_structural_inside_ng_template.js_0_730 | function MyComponent_ng_template_0_span_0_Template(rf, ctx) {
if (rf & 1) {
i0.ɵɵelement(0, "span");
} if (rf & 2) {
const $ctx_r2$ = i0.ɵɵnextContext(2);
i0.ɵɵattribute("someAttr", $ctx_r2$.someField);
}
}
function MyComponent_ng_template_0_Template(rf, ctx) {
if (rf & 1) {
i0.ɵɵtemplate(0, MyComponent_ng... | {
"end_byte": 730,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/attr_binding_on_structural_inside_ng_template.js"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/create_many_elements.ts_0_4332 | import { Component, NgModule } from '@angular/core';
@Component({
selector: 'my-component',
template: `
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>... | {
"end_byte": 4332,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/create_many_elements.ts"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/shorthand_property_declaration.ts_0_310 | import {Component, NgModule} from '@angular/core';
@Component({
template: `
<div (click)="_handleClick({a, b: 2, c})"></div>
`,
standalone: false
})
export class MyComponent {
a = 1;
c = 3;
_handleClick(_value: any) {}
}
@NgModule({declarations: [MyComponent]})
export class MyModule {
}
| {
"end_byte": 310,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/shorthand_property_declaration.ts"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/template_binding_pipe_template.js_0_413 | function MyComponent_div_0_Template(rf, ctx) {
if (rf & 1) {
$i0$.ɵɵelement(0, "div");
}
}
…
consts: [[__AttributeMarker.Template__, "ngIf"]],
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$i0$.ɵɵtemplate(0, MyComponent_div_0_Template, 1, 0, "div", 0);
$i0$.ɵɵpipe(1, "pipe");
} i... | {
"end_byte": 413,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/template_binding_pipe_template.js"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/unique_listener_function_names.js_0_82 | …
// NOTE: the assertions for this test happen through `verifyUniqueFunctions`.
| {
"end_byte": 82,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/unique_listener_function_names.js"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/template_with_structural_directive.ts_0_182 | import {Component} from '@angular/core';
@Component({
selector: 'my-component',
template: `
<ng-template *ngIf="true">Content</ng-template>
`,
})
export class MyComponent {
}
| {
"end_byte": 182,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/template_with_structural_directive.ts"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/ng_for_context_variables.ts_0_327 | import {Component, NgModule} from '@angular/core';
@Component({
selector: 'my-component',
template: `
<span *ngFor="let item of items; index as i">
{{ i }} - {{ item }}
</span>
`,
standalone: false
})
export class MyComponent {
}
@NgModule({declarations: [MyComponent]})
export class MyModu... | {
"end_byte": 327,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/ng_for_context_variables.ts"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/unique_template_function_names.ts_0_1263 | import {Component, NgModule} from '@angular/core';
@Component({
selector: 'a-component',
template: `
<div *ngFor="let item of items">
<p *ngIf="item < 10">less than 10</p>
<p *ngIf="item < 10">less than 10</p>
</div>
<div *ngFor="let item of items">
<p *ngIf="item > 10">more than ... | {
"end_byte": 1263,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/unique_template_function_names.ts"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/template_context_skip_template.js_0_1354 | function MyComponent_div_0_div_1_div_1_Template(rf, ctx) {
if (rf & 1) {
$i0$.ɵɵelementStart(0, "div");
$i0$.ɵɵtext(1);
$i0$.ɵɵelementEnd();
}
if (rf & 2) {
const $middle$ = $i0$.ɵɵnextContext().$implicit;
const $myComp$ = $i0$.ɵɵnextContext(2);
$r3$.ɵɵadvance();
$i0$.ɵɵtextInterpolate... | {
"end_byte": 1354,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/template_context_skip_template.js"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/ng_template_implicit.ts_0_219 | import {Component} from '@angular/core';
@Component({
selector: 'my-component',
template: '<ng-template let-a [ngIf]="true">{{a}}</ng-template>',
})
export class MyComponent {
p1!: any;
a1!: any;
c1!: any;
}
| {
"end_byte": 219,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/ng_template_implicit.ts"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/nested_ternary_operation.ts_0_268 | import {Component, NgModule} from '@angular/core';
@Component({
selector: 'my-component',
template: `
{{a?.b ? 1 : 2 }}`,
standalone: false
})
export class MyComponent {
a!: any;
}
@NgModule({declarations: [MyComponent]})
export class MyModule {
}
| {
"end_byte": 268,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/nested_ternary_operation.ts"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/self_closing_structural_directives.js_0_3349 | function MyComponent_img_2_Template(rf, ctx) {
if (rf & 1) {
i0.ɵɵi18nStart(0, 0, 1);
i0.ɵɵelement(1, "img");
i0.ɵɵi18nEnd();
}
}
function MyComponent_other_component_3_Template(rf, ctx) {
if (rf & 1) {
i0.ɵɵi18nStart(0, 0, 2);
i0.ɵɵelement(1, "other-component");
i0.ɵɵi18nEnd();
}
}
func... | {
"end_byte": 3349,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/self_closing_structural_directives.js"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/ng_for_parent_context_variables.ts_0_373 | import {Component, NgModule} from '@angular/core';
@Component({
selector: 'my-component',
template: `
<div *ngFor="let item of items; index as i">
<span *ngIf="showing">
{{ i }} - {{ item }}
</span>
</div>`,
standalone: false
})
export class MyComponent {
}
@NgModule({dec... | {
"end_byte": 373,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/ng_for_parent_context_variables.ts"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/unique_template_function_names_ng_content.ts_0_479 | import {Component, NgModule} from '@angular/core';
@Component({
selector: 'a-component',
template: `
<ng-content *ngIf="show"></ng-content>
`,
standalone: false
})
export class AComponent {
show = true;
}
@Component({
selector: 'b-component',
template: `
<ng-content *ngIf="show"></ng-c... | {
"end_byte": 479,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/unique_template_function_names_ng_content.ts"
} |
angular/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/ng_for_parent_context_variables.pipeline.js_0_1024 | function MyComponent_div_0_span_1_Template(rf, ctx) {
if (rf & 1) {
$i0$.ɵɵelementStart(0, "span");
$i0$.ɵɵtext(1);
$i0$.ɵɵelementEnd();
}
if (rf & 2) {
const $div$ = $i0$.ɵɵnextContext();
const $item$ = $div$.$implicit;
const $i$ = $div$.index;
$r3$.ɵɵadvance();
$i0$.ɵɵtextInterpolate2(" ", ... | {
"end_byte": 1024,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_template/ng_for_parent_context_variables.pipeline.js"
} |
angular/packages/compiler-cli/test/compliance/local/local_compile_spec.ts_0_994 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {FileSystem} from '../../../src/ngtsc/file_system';
import {CompileResult, compileTest} from '../test_helpers/... | {
"end_byte": 994,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/local/local_compile_spec.ts"
} |
angular/packages/compiler-cli/test/compliance/local/BUILD.bazel_0_580 | load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
ts_library(
name = "test_lib",
testonly = True,
srcs = ["local_compile_spec.ts"],
deps = [
"//packages/compiler-cli/src/ngtsc/file_system",
"//packages/compiler-cli/test/compliance/test_helpers",
],
)
jasmine_node_test... | {
"end_byte": 580,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/local/BUILD.bazel"
} |
angular/packages/compiler-cli/test/compliance/linked/linked_compile_spec.ts_0_4815 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import babel, {PluginObj} from '@babel/core';
import {needsLinking} from '../../../linker';
import {createEs2015Link... | {
"end_byte": 4815,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/linked/linked_compile_spec.ts"
} |
angular/packages/compiler-cli/test/compliance/linked/BUILD.bazel_0_860 | load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
ts_library(
name = "test_lib",
testonly = True,
srcs = ["linked_compile_spec.ts"],
deps = [
"//packages/compiler-cli/linker",
"//packages/compiler-cli/linker/babel",
"//packages/compiler-cli/private",
"//pac... | {
"end_byte": 860,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/linked/BUILD.bazel"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/di_checks.ts_0_518 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
/**
* Verifies that there is exactly one factory definition for the provided type.
*/
export function verifyUnique... | {
"end_byte": 518,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/di_checks.ts"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/compile_test.ts_0_6341 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import ts from 'typescript';
import {
AbsoluteFsPath,
FileSystem,
PathManipulation,
ReadonlyFileSystem,
} fr... | {
"end_byte": 6341,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/compile_test.ts"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/golden_partials.ts_0_1630 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
const headerStart =
'/********************************************************************************************... | {
"end_byte": 1630,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/golden_partials.ts"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/get_compliance_tests.ts_0_8192 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {runfiles} from '@bazel/runfiles';
import {
AbsoluteFsPath,
NodeJSFileSystem,
PathSegment,
ReadonlyFi... | {
"end_byte": 8192,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/get_compliance_tests.ts"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/get_compliance_tests.ts_8193_11472 | export interface ComplianceTest {
/** The path, relative to the test_cases directory, of the directory containing this test. */
relativePath: string;
/** The absolute path (on the real file-system) to the test case containing this test. */
realTestPath: AbsoluteFsPath;
/** A description of this particular tes... | {
"end_byte": 11472,
"start_byte": 8193,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/get_compliance_tests.ts"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/sourcemap_helpers.ts_0_8753 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {AbsoluteFsPath, ReadonlyFileSystem} from '../../../src/ngtsc/file_system';
import {ConsoleLogger, LogLevel} f... | {
"end_byte": 8753,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/sourcemap_helpers.ts"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/function_checks.ts_0_1358 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
/**
* Verify that all functions in the output have a unique name.
* @param output Compiler output.
* @param funct... | {
"end_byte": 1358,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/function_checks.ts"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/expect_emit.ts_0_7708 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {escapeRegExp} from '@angular/compiler/src/util';
const IDENTIFIER = /[A-Za-z_$ɵ][A-Za-z0-9_$]*/;
const COMME... | {
"end_byte": 7708,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/expect_emit.ts"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/expected_file_macros.ts_0_7595 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {AttributeMarker, SelectorFlags} from '@angular/compiler/src/core';
import {QueryFlags} from '@angular/compile... | {
"end_byte": 7595,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/expected_file_macros.ts"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/expected_file_macros.ts_7596_8263 | function flagUnion(
pattern: RegExp,
getFlagValue: (...match: string[]) => number,
): (typeof EXPECTED_FILE_MACROS)[number] {
return [
// Match at least one occurrence of the pattern, optionally followed by more occurrences
// separated by a pipe.
new RegExp(pattern.source + '(?:s*\\|s*' + pattern.sou... | {
"end_byte": 8263,
"start_byte": 7596,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/expected_file_macros.ts"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/check_errors.ts_0_1203 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {inspect} from 'util';
import {ExpectedError} from './get_compliance_tests';
export function checkErrors(
t... | {
"end_byte": 1203,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/check_errors.ts"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/test_runner.ts_0_3434 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {FileSystem} from '../../../src/ngtsc/file_system';
import {checkErrors, checkNoUnexpectedErrors} from './che... | {
"end_byte": 3434,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/test_runner.ts"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/i18n_helpers.ts_0_5390 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
/**
* Unique message id index that is needed to avoid different i18n vars with the same name to appear
* in the i1... | {
"end_byte": 5390,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/i18n_helpers.ts"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/i18n_checks.ts_0_2766 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
const EXTRACT_GENERATED_TRANSLATIONS_REGEXP =
/const\s*(.*?)\s*=\s*goog\.getMsg\("(.*?)",?\s*(.*?)\)/g;
/**
* Ver... | {
"end_byte": 2766,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/i18n_checks.ts"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/BUILD.bazel_0_703 | load("//tools:defaults.bzl", "ts_library")
ts_library(
name = "test_helpers",
testonly = True,
srcs = glob(
["**/*.ts"],
),
visibility = [
"//packages/compiler-cli/test/compliance:__subpackages__",
],
deps = [
"//packages:types",
"//packages/compiler",
... | {
"end_byte": 703,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/BUILD.bazel"
} |
angular/packages/compiler-cli/test/compliance/test_helpers/check_expectations.ts_0_4217 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {ReadonlyFileSystem} from '../../../src/ngtsc/file_system';
import {getBuildOutputDirectory, getRootDirectory... | {
"end_byte": 4217,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/compliance/test_helpers/check_expectations.ts"
} |
angular/packages/compiler-cli/test/ngtsc/template_mapping_spec.ts_0_4698 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
/// <reference types="node" />
import {inspect} from 'util';
import ts from 'typescript';
import {runInEachFileSyst... | {
"end_byte": 4698,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/template_mapping_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/template_mapping_spec.ts_4706_12118 | () => {
it('should map a simple input binding expression', async () => {
const mappings = await compileAndMap('<div [attr]="name"></div>');
expectMapping(mappings, {
source: '<div [attr]="name"></div>',
generated: 'i0.ɵɵelement(0, "div", 0)',
sourceUrl: '.... | {
"end_byte": 12118,
"start_byte": 4706,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/template_mapping_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/template_mapping_spec.ts_12126_16288 | async () => {
const mappings = await compileAndMap('<div *ngIf="showMessage()">{{ name }}</div>');
expectMapping(mappings, {
source: '<div *ngIf="showMessage()">',
generated: 'i0.ɵɵelementStart(0, "div")',
sourceUrl: '../test.ts',
});
// TODO... | {
"end_byte": 16288,
"start_byte": 12126,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/template_mapping_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/template_mapping_spec.ts_16296_24706 | const mappings = await compileAndMap(`<div i18n>Hello, World!</div>`);
expectMapping(mappings, {
source: '<div i18n>',
generated: 'i0.ɵɵelementStart(0, "div")',
sourceUrl: '../test.ts',
});
expectMapping(mappings, {
source: 'Hello, World... | {
"end_byte": 24706,
"start_byte": 16296,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/template_mapping_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/template_mapping_spec.ts_24706_31440 | {
const mappings = await compileAndMap(
'<div>this is a test</div><div>{{ 1 + 2 }}</div>',
'./dir/test.html',
);
// Creation mode
expectMapping(mappings, {
generated: 'i0.ɵɵelementStart(0, "div")',
source: '<div>',
sourceUrl: '../dir/tes... | {
"end_byte": 31440,
"start_byte": 24706,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/template_mapping_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/extended_template_diagnostics_spec.ts_0_8138 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import ts from 'typescript';
import {ErrorCode, ngErrorCode} from '../../src/ngtsc/diagnostics';
import {runInEachF... | {
"end_byte": 8138,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/extended_template_diagnostics_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/authoring_inputs_spec.ts_0_458 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import ts from 'typescript';
import {runInEachFileSystem} from '../../src/ngtsc/file_system/testing';
import {loadS... | {
"end_byte": 458,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/authoring_inputs_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/authoring_inputs_spec.ts_460_9684 | runInEachFileSystem(() => {
describe('initializer-based input() API', () => {
let env!: NgtscTestEnvironment;
beforeEach(() => {
env = NgtscTestEnvironment.setup(testFiles);
env.tsconfig({strictTemplates: true});
});
it('should handle a basic, primitive valued input', () => {
env.w... | {
"end_byte": 9684,
"start_byte": 460,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/authoring_inputs_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/authoring_inputs_spec.ts_9690_11904 | describe('diagnostics', () => {
it('should error when declared using an ES private field', () => {
env.write(
'test.ts',
`
import {Directive, input} from '@angular/core';
@Directive({
selector: '[directiveName]',
standalone: true,
... | {
"end_byte": 11904,
"start_byte": 9690,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/authoring_inputs_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/authoring_diagnostics_spec.ts_0_7802 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {runInEachFileSystem} from '../../src/ngtsc/file_system/testing';
import {loadStandardTestFiles} from '../../... | {
"end_byte": 7802,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/authoring_diagnostics_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/imports_spec.ts_0_4278 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import ts from 'typescript';
import {absoluteFrom} from '../../src/ngtsc/file_system';
import {runInEachFileSystem} ... | {
"end_byte": 4278,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/imports_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ls_typecheck_helpers_spec.ts_0_7841 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {PotentialImportMode} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
import ts from 'typescript';
impo... | {
"end_byte": 7841,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ls_typecheck_helpers_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ls_typecheck_helpers_spec.ts_7847_12040 | describe('can generate imports` ', () => {
it('for out of scope standalone components', () => {
env.write(
'one.ts',
`
import {Component} from '@angular/core';
@Component({
standalone: true,
selector: 'one-cmp',
template: '<div></div>',
})
export class O... | {
"end_byte": 12040,
"start_byte": 7847,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ls_typecheck_helpers_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/host_directives_spec.ts_0_8157 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import ts from 'typescript';
import {runInEachFileSystem} from '../../src/ngtsc/file_system/testing';
import {loadS... | {
"end_byte": 8157,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/host_directives_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/host_directives_spec.ts_8163_16742 | ition with forward references', () => {
env.write(
'test.ts',
`
import {Component, Directive, forwardRef, Input} from '@angular/core';
@Component({
selector: 'my-component',
template: '',
hostDirectives: [forwardRef(() => DirectiveB)],
stand... | {
"end_byte": 16742,
"start_byte": 8163,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/host_directives_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/host_directives_spec.ts_16748_17743 | st directive is bound', () => {
env.write(
'test.ts',
`
import {Directive, Component, Input} from '@angular/core';
@Directive({standalone: true})
export class HostDir {
@Input({alias: 'inputAlias', required: true})
input: any;
... | {
"end_byte": 17743,
"start_byte": 16748,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/host_directives_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/host_directives_spec.ts_17749_27548 | host directive is not standalone', () => {
env.write(
'test.ts',
`
import {Directive, Component, NgModule} from '@angular/core';
@Directive({
standalone: false
})
export class HostDir {}
@Directive({
hostDirectives:... | {
"end_byte": 27548,
"start_byte": 17749,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/host_directives_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/host_directives_spec.ts_27556_34923 | he same name', () => {
env.write(
'test.ts',
`
import {Directive, Input} from '@angular/core';
@Directive({selector: '[host-dir]', standalone: true})
class HostDir {
@Input('color') color?: string;
}
@Directive({
sel... | {
"end_byte": 34923,
"start_byte": 27556,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/host_directives_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/xi18n_spec.ts_0_3742 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {runInEachFileSystem} from '@angular/compiler-cli/src/ngtsc/file_system/testing';
import {loadStandardTestFil... | {
"end_byte": 3742,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/xi18n_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/xi18n_spec.ts_3744_9871 | const EXPECTED_XLIFF = `<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="fr" datatype="plaintext" original="ng2.template">
<body>
<trans-unit id="76e1eccb1b772fa9f294ef9c146ea6d0efa8a2d4" datatype="html">
<source>trans... | {
"end_byte": 9871,
"start_byte": 3744,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/xi18n_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/xi18n_spec.ts_9872_12626 | function writeTestCode(env: NgtscTestEnvironment): void {
const welcomeMessage = `
<!--i18n-->
Welcome<!--/i18n-->
`;
env.write(
'src/basic.html',
`<div title="translate me" i18n-title="meaning|desc"></div>
<p id="welcomeMessage">${welcomeMessage}</p>`,
);
env.write(
'src/comp1... | {
"end_byte": 12626,
"start_byte": 9872,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/xi18n_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_0_1862 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {NgtscProgram} from '@angular/compiler-cli/src/ngtsc/program';
import {CompilerOptions} from '@angular/compil... | {
"end_byte": 1862,
"start_byte": 0,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_1864_9561 | nEachFileSystem((os: string) => {
describe('ngtsc behavioral tests', () => {
let env!: NgtscTestEnvironment;
beforeEach(() => {
env = NgtscTestEnvironment.setup(testFiles);
env.tsconfig();
});
it('should accept relative file paths as command line argument', () => {
env.addCommandLi... | {
"end_byte": 9561,
"start_byte": 1864,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_9567_17822 | errors', () => {
env.write(
'test.ts',
`
import {Injectable, NgModule, forwardRef} from '@angular/core';
@Injectable()
export class Dep {}
@Injectable({ providedIn: forwardRef(() => Mod) })
export class Service {
constructor(dep: Dep) {}
... | {
"end_byte": 17822,
"start_byte": 9567,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_17828_23121 | {Component, NgModule} from '@angular/core';
@Component({
selector: 'broken-cmp',
template: '{{ broken = "true" }}', // assignment not legal in this context
standalone: false,
})
export class BrokenCmp {}
@NgModule({
declarations: [BrokenCmp],
... | {
"end_byte": 23121,
"start_byte": 17828,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_23126_30854 | Code to getInheritedFactory calls', () => {
env.tsconfig({
'annotateForClosureCompiler': true,
});
env.write(
`test.ts`,
`
import {Directive} from '@angular/core';
@Directive({
selector: '[base]',
})
... | {
"end_byte": 30854,
"start_byte": 23126,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_30860_39642 | Directive as AngularDirective,
Pipe as AngularPipe,
Injectable as AngularInjectable,
NgModule as AngularNgModule,
Input as AngularInput,
Output as AngularOutput
} from '@angular/core';
@AngularDirective()
export class TestBase {
@AngularInput() input: a... | {
"end_byte": 39642,
"start_byte": 30860,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_39648_48347 | <p>Hello World</p>');
env.write(
'test.ts',
`
import {Component} from '@angular/core';
@Component({
selector: 'test-cmp',
templateUrl: '/test.html',
standalone: false,
})
export class TestCmp {}
`,
);
env.driveMain();
... | {
"end_byte": 48347,
"start_byte": 39648,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_48353_56731 | env.write(
'test.ts',
`
import {NgModule} from '@angular/core';
@NgModule({id: module.id})
export class TestModule {}
`,
);
const diags = env.driveDiagnostics();
const jsContents = env.getContents('test.js');
expect(jsContents).toContain('i0.ɵ... | {
"end_byte": 56731,
"start_byte": 48353,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_56737_64852 | export class FooModule {}
`,
);
env.write(
'foo.ts',
`
import {Component} from '@angular/core';
@Component({
selector: 'foo',
template: '',
standalone: false,
})
export class Foo {}
`,
);
env.driveMain();
const jsCo... | {
"end_byte": 64852,
"start_byte": 56737,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_64858_71108 | export class TestPipe {
constructor(dep: Dep) {}
}
`,
);
env.driveMain();
const jsContents = env.getContents('test.js');
expect(jsContents).toContain(
'return new (__ngFactoryType__ || TestPipe)(i0.ɵɵdirectiveInject(Dep, 16));',
);
});
it('sh... | {
"end_byte": 71108,
"start_byte": 64858,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_71108_80917 | const text = ts.flattenDiagnosticMessageText(messageText, '\n');
expect(trim(text)).toContain(errorMessage);
}
it('should throw if invalid arguments are provided in @NgModule', () => {
env.tsconfig({});
env.write(
'test.ts',
`
import {NgModule} fro... | {
"end_byte": 80917,
"start_byte": 71108,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_80925_90567 | template: '...'
})
export class TestCmp {
// @ts-ignore
@HostBinding(['invalid-arg-type']) foo: any;
}
`,
);
verifyThrownError(
ErrorCode.VALUE_HAS_WRONG_TYPE,
`@HostBinding's argument must be a string`,
);... | {
"end_byte": 90567,
"start_byte": 80925,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_90575_97902 | interface InternalType {
foo: boolean;
}
export function toNumber(val: GenericWrapper<InternalType>) { return 1; }
`,
);
env.write(
'/test.ts',
`
import {Directive, Input} from '@angular/core';
imp... | {
"end_byte": 97902,
"start_byte": 90575,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_97908_106331 | 'test.ts',
`
import {Injectable} from '@angular/core';
@Injectable()
export class Test {
constructor(private notInjectable: string) {}
}
`,
);
const errors = env.driveDiagnostics();
expect(errors.lengt... | {
"end_byte": 106331,
"start_byte": 97908,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_106341_115927 | ic which we ignore in this
// test to verify that ngtsc's analysis is able to operate in this situation.
env.tsconfig({strictInjectionParameters: true});
env.write(
`test.ts`,
`
import {Injectable} from '@angular/core';
// @ts-expect-error
... | {
"end_byte": 115927,
"start_byte": 106341,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_115937_124305 | export abstract class ParentService {
constructor(private notInjectable: string) {}
}
@Injectable()
export abstract class AbstractMiddleService extends ParentService {}
@Injectable()
export class ConcreteMiddleService extends... | {
"end_byte": 124305,
"start_byte": 115937,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_124313_134284 | @Injectable()
export class Test {
constructor(private notInjectable: string) {}
}
`,
);
env.driveMain();
const jsContents = env.getContents('test.js');
expect(jsContents).toContain(
'Test.ɵfac = function Tes... | {
"end_byte": 134284,
"start_byte": 124313,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_134290_137810 | ource], //
[`a/app.ts`, `a/${resource}`, `/a/${resource}`],
// resource is one level up
[`a/app.ts`, resource, `../${resource}`], //
[`a/app.ts`, resource, `/${resource}`],
// component and resource are in different folders
[`a/app.ts`, `b/${resource}`, `../b/${resource... | {
"end_byte": 137810,
"start_byte": 134290,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_137816_146822 | taticallyAnalyzable(): ModuleWithProviders<SomeModule> {
console.log('this interferes with static analysis');
return {
ngModule: SomeModule,
providers: [],
};
}
@NgModule()
export class SomeModule {}
... | {
"end_byte": 146822,
"start_byte": 137816,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_146828_154760 | 'node_modules/router/index.d.ts',
`
import * as core from '@angular/core';
import {RouterModule} from 'router';
declare class RouterModule {
static forRoot(): core.ModuleWithProviders<RouterModule>;
static ɵmod: ɵɵNgModuleDeclaration<RouterModule, never, never, never... | {
"end_byte": 154760,
"start_byte": 146828,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_154766_163107 | oCmp {
@ContentChild('bar', {read: TemplateRef}) child: any;
@ContentChildren(TemplateRef) children: any;
get aview(): any { return null; }
@ViewChild('accessor') set aview(value: any) {}
}
`,
);
env.driveMain();
const jsContents = env.getContents('... | {
"end_byte": 163107,
"start_byte": 154766,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_163113_171447 | expect(trim(errors[0].messageText as string)).toContain(
'Host binding expression cannot contain pipes',
);
});
it('should generate host bindings for directives', () => {
env.write(
`test.ts`,
`
import {Component, HostBinding, HostListener, TemplateRef} from '@angul... | {
"end_byte": 171447,
"start_byte": 163113,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_171453_179454 | 3da8dff890e20cf76eb075d58900fbcd3\u241F8321000940098097247:Some text`',
);
});
it('should render custom id and legacy ids if `enableI18nLegacyMessageIdFormat` is not false', () => {
env.tsconfig({i18nFormatIn: 'xlf'});
env.write(
`test.ts`,
`
import {Component} from '@... | {
"end_byte": 179454,
"start_byte": 171453,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_179460_187847 | `
import {Injectable} from '@angular/core';
class Dep {}
@Injectable()
class Base {
constructor(dep: Dep) {}
}
@Injectable()
class Child extends Base {}
@Injectable()
class GrandChild extends Child {
constructor() {
... | {
"end_byte": 187847,
"start_byte": 179460,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_187853_193764 | {}
@NgModule({declarations: [TestComponent, TestDirective]}) class TestNgModule {}
@Pipe({name: 'pipe', standalone: false}) class TestPipe {}
`,
);
env.driveMain();
const jsContents = env.getContents('test.js');
expect(jsContents).toContain('\u0275setClassMetadata(TestComponent... | {
"end_byte": 193764,
"start_byte": 187853,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_193770_202069 | env.write(
`test.ts`,
`
import {Inject, Injectable, InjectionToken} from '@angular/core';
import * as ns from 'ns';
@Injectable()
export class MyService {
constructor(
zero: ns.Zero,
one: ns... | {
"end_byte": 202069,
"start_byte": 193770,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_202075_205173 | o} from './types';
import type * as types from './types';
@Component({
selector: 'some-comp',
template: '...',
})
export class SomeComp {
constructor(
@Inject('token') namedImport: TypeOnlyOne,
@Inject('tok... | {
"end_byte": 205173,
"start_byte": 202075,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_205179_214856 | yclicComponent],
})
export class Module {}
`,
);
env.write(
'cyclic.ts',
`
import {Component} from '@angular/core';
@Component({
selector: 'normal-component',
template: '<cyclic-component></cyclic-component>',
stan... | {
"end_byte": 214856,
"start_byte": 205179,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_214862_220616 | found with exportAs 'unknownTarget'.`);
});
});
describe('multiple local refs', () => {
const getComponentScript = (template: string): string => `
import {Component, Directive, NgModule} from '@angular/core';
@Component({
selector: 'my-cmp',
template: \`${template}\`,
... | {
"end_byte": 220616,
"start_byte": 214862,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_220622_227203 | e);
}
it('should provide a hint when importing an invalid NgModule from node_modules', () => {
env.write(
'node_modules/external/index.d.ts',
`
export declare class NotAModule {}
`,
);
env.write(
'test.ts',
`
import... | {
"end_byte": 227203,
"start_byte": 220622,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_227209_232082 | dule, [typeof ExternalDir], never, [typeof ExternalDir]>;
}
`,
);
env.write(
'test.ts',
`
import {Component, Directive, NgModule} from '@angular/core';
import {ExternalModule} from 'external';
@Component({
template: '<div test></div>',... | {
"end_byte": 232082,
"start_byte": 227209,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_232088_240790 | });
env.write('ignored.ts', 'export const TEST = "this is ignored";');
env.write('index.ts', 'export const ENTRY = "this is the entry";');
env.driveMain();
const jsContents = env.getContents('flat.js');
expect(jsContents).toContain(
"export * from './index';",
... | {
"end_byte": 240790,
"start_byte": 232088,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_240798_249947 | aration, ɵɵNgModuleDeclaration} from '@angular/core';
export declare class ExternalDir {
static ɵdir: ɵɵDirectiveDeclaration<ExternalDir, '[test]', never, never, never, never>;
}
export declare class ExternalModule {
static ɵmod: ɵɵNgModuleDeclaration<ExternalModule, [typeo... | {
"end_byte": 249947,
"start_byte": 240798,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_249955_258094 | static ɵmod: ɵɵNgModuleDeclaration<ExternalModule, [typeof ExternalDir], never, [typeof ExternalDir]>;
}
export {ExternalDir as ɵngExportɵExternalModuleɵExternalDir};
`,
);
env.write(
'test.ts',
`
import {Component, Directive, NgModule}... | {
"end_byte": 258094,
"start_byte": 249955,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_258100_266978 | c ɵmod: ɵɵNgModuleDeclaration<AlphaModule, [typeof ExternalDir], never, [typeof ExternalDir]>;
}
`,
);
// 'beta' re-exports AlphaModule from alpha.
env.write(
'beta.d.ts',
`
import {ɵɵNgModuleDeclaration} from '@angular/core';
import {AlphaModul... | {
"end_byte": 266978,
"start_byte": 258100,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_266986_269652 | })
export class IndexModule {}
`,
);
env.driveMain();
const jsContents = env.getContents('index.js');
expect(jsContents).toContain(
'export { TestDir as \u0275ng$root$other___test$$TestDir } from "root/other._$test";',
);
});
});
describe('... | {
"end_byte": 269652,
"start_byte": 266986,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_269658_278774 | ib.d.ts',
`
import {ɵɵComponentDeclaration, ɵɵDirectiveDeclaration, ElementRef} from '@angular/core';
export declare class BasePlain {}
export declare class BasePlainWithBlankConstructor {
constructor() {}
}
export declare class BasePlainWithCon... | {
"end_byte": 278774,
"start_byte": 269658,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_278782_287491 | );
const diags = env.driveDiagnostics();
expect(diags.length).toBe(0);
});
});
describe('inline resources', () => {
it('should process inline <style> tags', () => {
env.write(
'test.ts',
`
import {Component} from '@angular/core';
@C... | {
"end_byte": 287491,
"start_byte": 278782,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_287497_297074 | ir/a.css', '');
env.write('dir/b.css', ' ');
env.write(
'test.ts',
`
import {Component} from '@angular/core';
@Component({
selector: 'test-cmp',
styleUrls: ['./dir/a.css', './dir/b.css'],
template: '',
... | {
"end_byte": 297074,
"start_byte": 287497,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_297080_305925 | {
env.write(
'test.ts',
`
import {NgModule, Injectable, NgZone} from '@angular/core';
@Injectable({providedIn: 'root'})
class Service {}
class NotAService {
constructor(ngZone: NgZone) {}
}
@NgModule({
pr... | {
"end_byte": 305925,
"start_byte": 297080,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_305932_315216 | ule {}
`,
);
const diags = env.driveDiagnostics();
expect(diags.length).toBe(1);
expect(diags[0].messageText).toContain('cannot be created via dependency injection');
});
it('should not error when an class with a factory definition and a non-trivial constructor in... | {
"end_byte": 315216,
"start_byte": 305932,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
angular/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts_315224_323714 | est.ts'));
expect(
diags[0].file?.text.slice(diags[0].start!, diags[0].start! + diags[0].length!),
).toEqual('<div i18n>Content</div>');
});
it('reports a diagnostic on nested i18n sections with tags in between', () => {
env.write(
'test.ts',
... | {
"end_byte": 323714,
"start_byte": 315224,
"url": "https://github.com/angular/angular/blob/main/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.