_id
stringlengths
21
254
text
stringlengths
1
93.7k
metadata
dict
angular/packages/core/test/acceptance/content_spec.ts_35791_44633
describe('on inline templates (e.g. *ngIf)', () => { it('should work when matching the element name', () => { let divDirectives = 0; @Component({ selector: 'selector-proj', template: '<ng-content select="div"></ng-content>', standalone: false, }) class SelectedNgCont...
{ "end_byte": 44633, "start_byte": 35791, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/content_spec.ts" }
angular/packages/core/test/acceptance/content_spec.ts_44639_45736
it('selection of child element should properly work even with confusing attribute names', () => { @Component({ selector: 'child-comp', template: '<ng-content select=".title"></ng-content>', standalone: false, }) class ChildComp {} @Component({ selector: 'parent-c...
{ "end_byte": 45736, "start_byte": 44639, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/content_spec.ts" }
angular/packages/core/test/acceptance/content_spec.ts_45740_55077
describe('fallback content', () => { it('should render the fallback content if nothing is projected into a slot', () => { @Component({ selector: 'projection', template: ` <ng-content select="[one]">One fallback</ng-content>|` + `<ng-content>Catch-all fallback</ng-...
{ "end_byte": 55077, "start_byte": 45740, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/content_spec.ts" }
angular/packages/core/test/acceptance/content_spec.ts_55083_62025
it('should render the fallback content if content is not provided through projectableNodes', () => { @Component({ standalone: true, template: `<ng-content>One fallback</ng-content>|` + `<ng-content>Two fallback</ng-content>|<ng-content>Three fallback</ng-content>`, }) ...
{ "end_byte": 62025, "start_byte": 55083, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/content_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_0_620
/** * @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 {CommonModule} from '@angular/common'; import { AfterViewInit, Component, ContentChild, ContentChildr...
{ "end_byte": 620, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_622_10581
describe('query logic', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [ AppComp, QueryComp, SimpleCompA, SimpleCompB, StaticViewQueryComp, TextDirective, SubclassStaticViewQueryComp, StaticContentQueryComp, S...
{ "end_byte": 10581, "start_byte": 622, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_10587_13915
it('should support ViewChildren query inherited from undecorated grand superclasses', () => { @Directive({ selector: '[some-dir]', standalone: false, }) class SomeDir {} class MySuperComp { @ViewChildren(SomeDir) foo!: QueryList<SomeDir>; } class MyComp exte...
{ "end_byte": 13915, "start_byte": 10587, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_13919_22296
describe('content queries', () => { it('should return Component instance when Component is labeled and retrieved', () => { const template = ` <local-ref-query-component #q> <simple-comp-a #contentQuery></simple-comp-a> </local-ref-query-component> `; const fix...
{ "end_byte": 22296, "start_byte": 13919, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_22302_31200
it('should support multiple content query components (multiple template passes)', () => { const template = ` <static-content-query-comp> <div [text]="text"></div> <span #foo></span> </static-content-query-comp> <static-content-query-com...
{ "end_byte": 31200, "start_byte": 22302, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_31206_40110
it('should not match directive host with content queries', () => { @Directive({ selector: '[content-query]', standalone: true, }) class ContentQueryDirective { @ContentChildren('foo', {descendants: true}) foos!: QueryList<ElementRef>; } @Component({ standal...
{ "end_byte": 40110, "start_byte": 31206, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_40113_40423
it('should generate an empty QueryList for root components', () => { const fixture = TestBed.createComponent(QueryComp); fixture.detectChanges(); expect(fixture.componentInstance.contentChildren).toBeInstanceOf(QueryList); expect(fixture.componentInstance.contentChildren.length).toBe(0); });
{ "end_byte": 40423, "start_byte": 40113, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_40427_49862
describe('descendants: false (default)', () => { /** * A helper function to check if a given object looks like ElementRef. It is used in place of * the `instanceof ElementRef` check since ivy returns a type that looks like ElementRef (have * the same properties but doesn't pass the instanceof Element...
{ "end_byte": 49862, "start_byte": 40427, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_49866_59034
describe('read option', () => { @Directive({selector: '[child]', standalone: true}) class Child {} @Directive({selector: '[otherChild]', standalone: true}) class OtherChild {} it('should query using type predicate and read ElementRef', () => { @Component({ standalone: true, i...
{ "end_byte": 59034, "start_byte": 49866, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_59040_67440
it('should read directive instance if element queried for has an exported directive with a matching name', () => { @Directive({selector: '[child]', exportAs: 'child', standalone: true}) class ChildDirective {} @Component({ standalone: true, imports: [ChildDirective], template:...
{ "end_byte": 67440, "start_byte": 59040, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_67444_70096
describe('observable interface', () => { it('should allow observing changes to query list', () => { const fixture = TestBed.createComponent(QueryCompWithChanges); let changes = 0; fixture.detectChanges(); fixture.componentInstance.foos.changes.subscribe((value: any) => { changes += ...
{ "end_byte": 70096, "start_byte": 67444, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_70100_77208
describe('view boundaries', () => { describe('ViewContainerRef', () => { @Directive({ selector: '[vc]', exportAs: 'vc', standalone: false, }) class ViewContainerManipulatorDirective { constructor(private _vcRef: ViewContainerRef) {} insertTpl(tpl: TemplateR...
{ "end_byte": 77208, "start_byte": 70100, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_77215_83461
it('should report results when different instances of TemplateRef are inserted into one ViewContainerRefs', () => { @Component({ selector: 'test-comp', template: ` <ng-template #tpl1 let-idx="idx"> <div #foo [id]="'foo1_' + idx"></div> </ng-temp...
{ "end_byte": 83461, "start_byte": 77215, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_83465_89023
describe('non-regression', () => { it('should query by provider super-type in an embedded view', () => { @Directive({ selector: '[child]', standalone: false, }) class Child {} @Directive({ selector: '[parent]', providers: [{provide: Child, useExisting: Parent...
{ "end_byte": 89023, "start_byte": 83465, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_89027_98279
describe('querying for string token providers', () => { @Directive({ selector: '[text-token]', providers: [{provide: 'Token', useExisting: TextTokenDirective}], standalone: false, }) class TextTokenDirective {} it('should match string injection token in a ViewChild query', () => { ...
{ "end_byte": 98279, "start_byte": 89027, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/query_spec.ts_98281_102459
@Component({ selector: 'static-content-query-comp', template: `<ng-content></ng-content>`, standalone: false, }) class StaticContentQueryComp { private _textDir!: TextDirective; private _foo!: ElementRef; setEvents: string[] = []; @ContentChild(TextDirective, {static: true}) get textDir(): TextDirectiv...
{ "end_byte": 102459, "start_byte": 98281, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/query_spec.ts" }
angular/packages/core/test/acceptance/router_integration_spec.ts_0_1551
/** * @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 {APP_BASE_HREF} from '@angular/common'; import {NgModule} from '@angular/core'; import {TestBed} from '@angul...
{ "end_byte": 1551, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/router_integration_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_0_4487
/** * @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 {state, style, trigger} from '@angular/animations'; import { Component, ContentChildren, Directive, E...
{ "end_byte": 4487, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_4491_10930
describe('ngOnChanges', () => { it('should be inherited when super is a directive', () => { const log: string[] = []; @Directive({ selector: '[superDir]', standalone: false, }) class SuperDirective implements OnChanges { @Input() someInput = ''; ngOnChanges(...
{ "end_byte": 10930, "start_byte": 4491, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_10934_19252
describe('of bare super class by a directive', () => { // TODO: Add tests for ContentChild // TODO: Add tests for ViewChild describe('lifecycle hooks', () => { const fired: string[] = []; class SuperDirective { ngOnInit() { fired.push('super init'); } ngOnDest...
{ "end_byte": 19252, "start_byte": 10934, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_19258_28824
describe('inputs', () => { // TODO: add test where the two inputs have a different alias // TODO: add test where super has an @Input() on the property, and sub does not // TODO: add test where super has an @Input('alias') on the property and sub has no alias it('should inherit inputs', () => { ...
{ "end_byte": 28824, "start_byte": 19258, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_28825_38821
() => { // TODO: Add tests for ContentChild // TODO: Add tests for ViewChild describe('lifecycle hooks', () => { const fired: string[] = []; @Directive({ selector: '[super-dir]', standalone: false, }) class SuperDirective { ngOnInit() { fired.push(...
{ "end_byte": 38821, "start_byte": 28825, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_38827_45440
describe('outputs', () => { // TODO: add tests where both sub and super have Output on same property with different // aliases // TODO: add test where super has property with alias and sub has property with no alias // TODO: add test where super has an @Input() on the property, and sub does not ...
{ "end_byte": 45440, "start_byte": 38827, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_45444_54082
describe('of a directive by a bare class then by another directive', () => { // TODO: Add tests for ContentChild // TODO: Add tests for ViewChild describe('lifecycle hooks', () => { const fired: string[] = []; @Directive({ selector: '[super-dir]', standalone: false, }) ...
{ "end_byte": 54082, "start_byte": 45444, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_54088_63471
describe('inputs', () => { // TODO: add test where the two inputs have a different alias // TODO: add test where super has an @Input() on the property, and sub does not // TODO: add test where super has an @Input('alias') on the property and sub has no alias it('should inherit inputs', () => { ...
{ "end_byte": 63471, "start_byte": 54088, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_63476_72184
// TODO: sub has ViewChildren and super has ContentChildren on same property // TODO: sub has ContentChild and super has ContentChildren on same property }); describe('of bare super class by a component', () => { // TODO: Add tests for ContentChild // TODO: Add tests for ViewChild describe('lifecyc...
{ "end_byte": 72184, "start_byte": 63476, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_72190_79992
describe('inputs', () => { // TODO: add test where the two inputs have a different alias // TODO: add test where super has an @Input() on the property, and sub does not // TODO: add test where super has an @Input('alias') on the property and sub has no alias it('should inherit inputs', () => { ...
{ "end_byte": 79992, "start_byte": 72190, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_79996_88777
describe('of a directive inherited by a component', () => { // TODO: Add tests for ContentChild // TODO: Add tests for ViewChild describe('lifecycle hooks', () => { const fired: string[] = []; @Directive({ selector: '[super-dir]', standalone: false, }) class SuperDir...
{ "end_byte": 88777, "start_byte": 79996, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_88783_98215
describe('inputs', () => { // TODO: add test where the two inputs have a different alias // TODO: add test where super has an @Input() on the property, and sub does not // TODO: add test where super has an @Input('alias') on the property and sub has no alias it('should inherit inputs', () => { ...
{ "end_byte": 98215, "start_byte": 88783, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_98220_107091
// TODO: sub has ContentChild and super has ContentChildren on same property }); describe('of a directive inherited by a bare class and then by a component', () => { // TODO: Add tests for ContentChild // TODO: Add tests for ViewChild describe('lifecycle hooks', () => { const fired: string[] = []...
{ "end_byte": 107091, "start_byte": 98220, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_107097_116565
describe('inputs', () => { // TODO: add test where the two inputs have a different alias // TODO: add test where super has an @Input() on the property, and sub does not // TODO: add test where super has an @Input('alias') on the property and sub has no alias it('should inherit inputs', () => { ...
{ "end_byte": 116565, "start_byte": 107097, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_116570_126014
// TODO: sub has HostBinding and super has ContentChild on same property // TODO: sub has HostBinding and super has ContentChildren on same property // TODO: sub has ViewChild and super has ViewChildren on same property // TODO: sub has ViewChild and super has ContentChild on same property // TODO: sub ...
{ "end_byte": 126014, "start_byte": 116570, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_126020_134707
describe('inputs', () => { // TODO: add test where the two inputs have a different alias // TODO: add test where super has an @Input() on the property, and sub does not // TODO: add test where super has an @Input('alias') on the property and sub has no alias it('should inherit inputs', () => { ...
{ "end_byte": 134707, "start_byte": 126020, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_134713_141054
it('should inherit ContentChildren queries', () => { let foundQueryList: QueryList<ChildDir>; @Directive({ selector: '[child-dir]', standalone: false, }) class ChildDir {} @Component({ selector: 'super-comp', template: `<p>super</p>`, standalone: f...
{ "end_byte": 141054, "start_byte": 134713, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_141058_149957
describe('of a component inherited by a bare class then by a component', () => { // TODO: Add tests for ContentChild // TODO: Add tests for ViewChild describe('lifecycle hooks', () => { const fired: string[] = []; @Component({ selector: 'super-comp', template: `<p>super</p>`, ...
{ "end_byte": 149957, "start_byte": 141058, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_149963_158868
describe('inputs', () => { // TODO: add test where the two inputs have a different alias // TODO: add test where super has an @Input() on the property, and sub does not // TODO: add test where super has an @Input('alias') on the property and sub has no alias it('should inherit inputs', () => { ...
{ "end_byte": 158868, "start_byte": 149963, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/inherit_definition_feature_spec.ts_158874_162836
it('should inherit ContentChildren queries', () => { let foundQueryList: QueryList<ChildDir>; @Directive({ selector: '[child-dir]', standalone: false, }) class ChildDir {} @Component({ selector: 'super-comp', template: `<p>super</p>`, standalone: f...
{ "end_byte": 162836, "start_byte": 158874, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/inherit_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/change_detection_signals_in_zones_spec.ts_0_5858
/** * @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 {NgFor, NgIf} from '@angular/common'; import { ApplicationRef, ChangeDetectionStrategy, ChangeDetectorR...
{ "end_byte": 5858, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/change_detection_signals_in_zones_spec.ts" }
angular/packages/core/test/acceptance/change_detection_signals_in_zones_spec.ts_5860_14927
describe('OnPush components with signals', () => { it('marks view dirty', () => { @Component({ template: `{{value()}}{{incrementTemplateExecutions()}}`, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, }) class OnPushCmp { numTemplateExecutions = 0; value = ...
{ "end_byte": 14927, "start_byte": 5860, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/change_detection_signals_in_zones_spec.ts" }
angular/packages/core/test/acceptance/change_detection_signals_in_zones_spec.ts_14931_19959
it('can have signals in both template and host bindings', () => { @Component({ template: ``, selector: 'child', host: {'[class.blue]': 'useBlue()'}, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, }) class ChildCmp { useBlue = signal(false); } ...
{ "end_byte": 19959, "start_byte": 14931, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/change_detection_signals_in_zones_spec.ts" }
angular/packages/core/test/acceptance/change_detection_signals_in_zones_spec.ts_19963_27052
describe('embedded views', () => { describe('with a signal read after view creation during an update pass', () => { it('should work with native control flow', () => { @Component({ template: ` @if (true) { } {{val()}} `, standalone: true, changeDete...
{ "end_byte": 27052, "start_byte": 19963, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/change_detection_signals_in_zones_spec.ts" }
angular/packages/core/test/acceptance/change_detection_signals_in_zones_spec.ts_27056_32487
describe('shielded by non-dirty OnPush', () => { @Component({ selector: 'signal-component', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: `{{value()}}`, }) class SignalComponent { value = signal('initial'); afterViewCheckedRuns = 0; co...
{ "end_byte": 32487, "start_byte": 27056, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/change_detection_signals_in_zones_spec.ts" }
angular/packages/core/test/acceptance/control_flow_switch_spec.ts_0_6410
/** * @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 {ChangeDetectorRef, Component, inject, Pipe, PipeTransform} from '@angular/core'; import {TestBed} from '@ang...
{ "end_byte": 6410, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/control_flow_switch_spec.ts" }
angular/packages/core/test/acceptance/exports_spec.ts_0_8648
/** * @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 { Component, Directive, DoCheck, Input, OnChanges, OnInit, SimpleChanges, Type, } from '@angu...
{ "end_byte": 8648, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/exports_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_0_2355
/** * @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 {CommonModule} from '@angular/common'; import { assertInInjectionContext, Attribute, ChangeDetectorRef,...
{ "end_byte": 2355, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_2357_10348
be('importProvidersFrom', () => { // Set of tokens used in various tests. const A = new InjectionToken('A'); const B = new InjectionToken('B'); const C = new InjectionToken('C'); const D = new InjectionToken('D'); it('should collect providers from NgModules', () => { @NgModule({ providers: [ ...
{ "end_byte": 10348, "start_byte": 2357, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_10350_14435
be('EnvironmentProviders', () => { const TOKEN = new InjectionToken<string>('TOKEN'); const environmentProviders = makeEnvironmentProviders([ { provide: TOKEN, useValue: 'token!', }, ]); it('should be accepted by TestBed providers', () => { TestBed.configureTestingModule({ provide...
{ "end_byte": 14435, "start_byte": 10350, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_14439_22413
be('directive injection', () => { let log: string[] = []; @Directive({ selector: '[dirB]', exportAs: 'dirB', standalone: false, }) class DirectiveB { @Input() value = 'DirB'; constructor() { log.push(this.value); } } beforeEach(() => (log = [])); ...
{ "end_byte": 22413, "start_byte": 14439, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_22419_32000
ould not use a parent when peer dep is available', () => { let count = 1; @Directive({ selector: '[dirB]', standalone: false, }) class DirectiveB { count: number; constructor() { log.push(`DirB`); this.count = count++; } } ...
{ "end_byte": 32000, "start_byte": 22419, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_32006_41248
ould throw if directive is not found anywhere', () => { @Directive({ selector: '[dirB]', standalone: false, }) class DirectiveB { constructor() {} } @Directive({ selector: '[dirA]', standalone: false, }) class DirectiveA { constr...
{ "end_byte": 41248, "start_byte": 32006, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_41256_52248
be('SkipSelf', () => { describe('Injectors', () => { it('should support @SkipSelf when injecting Injectors', () => { @Component({ selector: 'parent', template: '<child></child>', providers: [ { provide: 'token', ...
{ "end_byte": 52248, "start_byte": 41256, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_52258_59899
be('@SkipSelf when parent contains embedded views', () => { it('should work for `ElementRef` token', () => { let requestedElementRef: ElementRef; @Component({ selector: 'child', template: '...', standalone: false, }) cla...
{ "end_byte": 59899, "start_byte": 52258, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_59909_68666
be('TemplateRef', () => { // SkipSelf doesn't make sense to use with TemplateRef since you // can't inject TemplateRef on a regular element and you can initialize // a child component on a nested `<ng-template>` only when a component/directive // on a parent `<ng-template>` is in...
{ "end_byte": 68666, "start_byte": 59909, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_68676_78551
be('ChangeDetectorRef', () => { it('should support @SkipSelf when injecting ChangeDetectorRef', () => { let parentRef: ChangeDetectorRef | undefined; let childRef: ChangeDetectorRef | undefined; @Directive({ selector: '[parent]', standalone: fal...
{ "end_byte": 78551, "start_byte": 68676, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_78559_85993
be('@Host', () => { @Directive({ selector: '[dirA]', standalone: false, }) class DirectiveA { constructor(@Host() public dirB: DirectiveB) {} } @Directive({ selector: '[dirString]', standalone: false, }) class Dir...
{ "end_byte": 85993, "start_byte": 78559, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_86001_93651
be('`InjectFlags` support in NodeInjector', () => { it('should support Optional flag in NodeInjector', () => { const NON_EXISTING_PROVIDER = new InjectionToken<string>('non-existing'); @Component({ template: '...', standalone: false, }) class MyCom...
{ "end_byte": 93651, "start_byte": 86001, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_93655_102376
('service injection', () => { it('should create instance even when no injector present', () => { @Injectable({providedIn: 'root'}) class MyService { value = 'MyService'; } @Component({ template: '<div>{{myService.value}}</div>', standalone: false, }) class...
{ "end_byte": 102376, "start_byte": 93655, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_102380_109563
('Special tokens', () => { describe('Injector', () => { it('should inject the injector', () => { @Directive({ selector: '[injectorDir]', standalone: false, }) class InjectorDir { constructor(public injector: Injector) {} } @Directive({ ...
{ "end_byte": 109563, "start_byte": 102380, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_109569_115656
('TemplateRef', () => { @Directive({ selector: '[dir]', exportAs: 'dir', standalone: false, }) class MyDir { value: string; constructor(public templateRef: TemplateRef<any>) { this.value = (templateRef.constructor as any).name; } } ...
{ "end_byte": 115656, "start_byte": 109569, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_115662_125097
('ChangeDetectorRef', () => { @Directive({ selector: '[dir]', exportAs: 'dir', standalone: false, }) class MyDir { value: string; constructor(public cdr: ChangeDetectorRef) { this.value = (cdr.constructor as any).name; } } @Directiv...
{ "end_byte": 125097, "start_byte": 115662, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_125101_133634
('attribute tokens', () => { it('should be able to provide an attribute token', () => { const TOKEN = new InjectionToken<string>('Some token'); function factory(token: string): string { return token + ' with factory'; } @Component({ selector: 'my-comp', template: '......
{ "end_byte": 133634, "start_byte": 125101, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_133638_139130
jection flags', () => { describe('represented as an options object argument', () => { it('should be able to optionally inject a service', () => { const TOKEN = new InjectionToken<string>('TOKEN'); @Component({ standalone: true, template: '', }) class TestCm...
{ "end_byte": 139130, "start_byte": 133638, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_139134_147664
nInInjectionContext', () => { it("should return the function's return value", () => { const injector = TestBed.inject(EnvironmentInjector); const returnValue = runInInjectionContext(injector, () => 3); expect(returnValue).toBe(3); }); it('should work with an NgModuleRef injector', () => {...
{ "end_byte": 147664, "start_byte": 139134, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_147668_151039
ot cause cyclic dependency if same token is requested in deps with @SkipSelf', () => { @Component({ selector: 'my-comp', template: '...', providers: [ { provide: LOCALE_ID, useFactory: () => 'ja-JP', // Note: `LOCALE_ID` is also provided within APPLICATION_MOD...
{ "end_byte": 151039, "start_byte": 147668, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_151043_157945
ttribute', () => { it('should inject attributes', () => { @Directive({ selector: '[dir]', standalone: false, }) class MyDir { constructor( @Attribute('exist') public exist: string, @Attribute('nonExist') public nonExist: string, ) {} } ...
{ "end_byte": 157945, "start_byte": 151043, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_157949_166907
stAttributeToken', () => { it('should inject an attribute on an element node', () => { @Directive({selector: '[dir]', standalone: true}) class Dir { value = inject(new HostAttributeToken('some-attr')); } @Component({ standalone: true, template: '<div dir some-attr="f...
{ "end_byte": 166907, "start_byte": 157949, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_166911_173265
ST_TAG_NAME', () => { it('should inject the tag name on an element node', () => { @Directive({selector: '[dir]', standalone: true}) class Dir { value = inject(HOST_TAG_NAME); } @Component({ standalone: true, template: ` <div dir #v1></div> <span d...
{ "end_byte": 173265, "start_byte": 166911, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_173269_177615
ovider access on the same node', () => { const token = new InjectionToken<number>('token'); it('pipes should access providers from the component they are on', () => { @Pipe({ name: 'token', standalone: false, }) class TokenPipe { constructor(@Inject(token) private _tok...
{ "end_byte": 177615, "start_byte": 173269, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_177619_186682
jector when creating embedded view', () => { const token = new InjectionToken<string>('greeting'); @Directive({ selector: 'menu-trigger', standalone: false, }) class MenuTrigger { @Input('triggerFor') menu!: TemplateRef<unknown>; constructor(private viewContainerRef: ViewContai...
{ "end_byte": 186682, "start_byte": 177619, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_186688_195912
ave value from custom injector take precedence over module injector', () => { @Directive({ selector: 'menu', standalone: false, }) class Menu { constructor(@Inject(token) public tokenValue: string) {} } @Component({ template: ` <menu-trigger [trig...
{ "end_byte": 195912, "start_byte": 186688, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_195918_205081
se a custom injector when the view is created outside of the declaration view', () => { const declarerToken = new InjectionToken<string>('declarerToken'); const creatorToken = new InjectionToken<string>('creatorToken'); @Directive({ selector: 'menu', standalone: false, }) ...
{ "end_byte": 205081, "start_byte": 195918, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/di_spec.ts_205087_207021
ot resolve value at insertion location', () => { @Directive({ selector: 'menu', standalone: false, }) class Menu { constructor(@Inject(token) public tokenValue: string) {} } @Directive({ selector: '[provide-token]', providers: [{provide: token, useV...
{ "end_byte": 207021, "start_byte": 205087, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/di_spec.ts" }
angular/packages/core/test/acceptance/csp_spec.ts_0_4118
/*! * @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 { Component, CSP_NONCE, destroyPlatform, ElementRef, inject, ViewEncapsulation, } from '@angular/...
{ "end_byte": 4118, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/csp_spec.ts" }
angular/packages/core/test/acceptance/copy_definition_feature_spec.ts_0_2742
/** * @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 { Component, NgModule, ɵɵCopyDefinitionFeature as CopyDefinitionFeature, ɵɵdefineComponent as defineC...
{ "end_byte": 2742, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/copy_definition_feature_spec.ts" }
angular/packages/core/test/acceptance/authoring/signal_queries_spec.ts_0_9534
/** * @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 { Component, computed, contentChild, contentChildren, createComponent, Directive, ElementRef, ...
{ "end_byte": 9534, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/authoring/signal_queries_spec.ts" }
angular/packages/core/test/acceptance/authoring/signal_queries_spec.ts_9538_19064
describe('content queries', () => { it('should run content queries defined on components', () => { @Component({ selector: 'query-cmp', standalone: true, template: `{{noOfEls()}}`, }) class QueryComponent { elements = contentChildren('el'); element = contentC...
{ "end_byte": 19064, "start_byte": 9538, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/authoring/signal_queries_spec.ts" }
angular/packages/core/test/acceptance/authoring/signal_queries_spec.ts_19068_21715
describe('mix of signal and decorator queries', () => { it('should allow specifying both types of queries in one component', () => { @Component({ standalone: true, template: ` <div #el></div> @if (show) { <div #el></div> } `, }) cla...
{ "end_byte": 21715, "start_byte": 19068, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/authoring/signal_queries_spec.ts" }
angular/packages/core/test/acceptance/authoring/signal_inputs_spec.ts_0_8160
/** * @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 { Component, computed, Directive, effect, EventEmitter, input, Output, ViewChild, } from '@an...
{ "end_byte": 8160, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/authoring/signal_inputs_spec.ts" }
angular/packages/core/test/acceptance/authoring/authoring_test_compiler.ts_0_1510
/** * @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 {ImportedSymbolsTracker} from '@angular/compiler-cli/src/ngtsc/imports'; import {TypeScriptReflectionHost} fr...
{ "end_byte": 1510, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/authoring/authoring_test_compiler.ts" }
angular/packages/core/test/acceptance/authoring/BUILD.bazel_0_2008
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite", "ng_module", "nodejs_binary", "npm_package_bin", "ts_library") package(default_visibility = ["//visibility:private"]) TEST_FILES = glob( ["*.ts"], exclude = ["authoring_test_compiler.ts"], ) TEST_DEPS = [ "//packages/core", "//...
{ "end_byte": 2008, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/authoring/BUILD.bazel" }
angular/packages/core/test/acceptance/authoring/model_inputs_spec.ts_0_8197
/*! * @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 { Component, Directive, EventEmitter, Input, model, OnChanges, Output, signal, SimpleChange...
{ "end_byte": 8197, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/authoring/model_inputs_spec.ts" }
angular/packages/core/test/acceptance/authoring/model_inputs_spec.ts_8201_16213
it('should support binding to an aliased model input and output separately', () => { const emittedValues: number[] = []; @Directive({selector: '[dir]', standalone: true}) class Dir { value = model(0, {alias: 'alias'}); } @Component({ template: '<div [alias]="value()" (aliasChange)="cha...
{ "end_byte": 16213, "start_byte": 8201, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/authoring/model_inputs_spec.ts" }
angular/packages/core/test/acceptance/authoring/model_inputs_spec.ts_16217_17523
it('should assign a debugName to the underlying watcher node when a debugName is provided', () => { @Directive({selector: '[dir]', standalone: true}) class Dir { value = model(0, {debugName: 'TEST_DEBUG_NAME'}); } @Component({ template: '<div [(value)]="value" dir></div>', standalone:...
{ "end_byte": 17523, "start_byte": 16217, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/authoring/model_inputs_spec.ts" }
angular/packages/core/test/acceptance/authoring/output_function_spec.ts_0_5045
/*! * @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 { Component, Directive, effect, ErrorHandler, EventEmitter, output, signal, } from '@angular/co...
{ "end_byte": 5045, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/authoring/output_function_spec.ts" }
angular/packages/core/test/acceptance/authoring/output_function_spec.ts_5049_9794
describe('outputFromObservable()', () => { it('should support using a `Subject` as source', () => { @Directive({ selector: '[dir]', standalone: true, }) class Dir { onBla$ = new Subject<number>(); onBla = outputFromObservable(this.onBla$); } @Component(...
{ "end_byte": 9794, "start_byte": 5049, "url": "https://github.com/angular/angular/blob/main/packages/core/test/acceptance/authoring/output_function_spec.ts" }
angular/packages/core/test/render3/integration_spec.ts_0_643
/** * @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 {CommonModule} from '@angular/common'; import {Component, Directive, HostBinding} from '@angular/core'; impor...
{ "end_byte": 643, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/render3/integration_spec.ts" }
angular/packages/core/test/render3/integration_spec.ts_645_9661
describe('element discovery', () => { it('should only monkey-patch immediate child nodes in a component', () => { @Component({ standalone: true, template: '<div><p></p></div>', }) class StructuredComp {} const fixture = TestBed.createComponent(StructuredComp); fixture.detectChanges();...
{ "end_byte": 9661, "start_byte": 645, "url": "https://github.com/angular/angular/blob/main/packages/core/test/render3/integration_spec.ts" }
angular/packages/core/test/render3/integration_spec.ts_9665_17159
it('should return `null` when an element context is retrieved that is a DOM node that was not created by Angular', () => { @Component({ selector: 'structured-comp', standalone: true, template: ` <section></section> `, }) class StructuredComp {} const fixture = ...
{ "end_byte": 17159, "start_byte": 9665, "url": "https://github.com/angular/angular/blob/main/packages/core/test/render3/integration_spec.ts" }
angular/packages/core/test/render3/integration_spec.ts_17163_21723
it('should monkey-patch sub components with the view data and then replace them with the context result once a lookup occurs', () => { @Component({ selector: 'child-comp', standalone: true, template: ` <div></div> <div></div> <div></div> `, }) ...
{ "end_byte": 21723, "start_byte": 17163, "url": "https://github.com/angular/angular/blob/main/packages/core/test/render3/integration_spec.ts" }
angular/packages/core/test/render3/metadata_spec.ts_0_2234
/** * @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 {Type} from '../../src/interface/type'; import {setClassMetadata} from '../../src/render3/metadata'; interfa...
{ "end_byte": 2234, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/render3/metadata_spec.ts" }
angular/packages/core/test/render3/jit_environment_spec.ts_0_2908
/** * @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 {ExternalReference} from '@angular/compiler'; import {Identifiers} from '@angular/compiler/src/render3/r3_ide...
{ "end_byte": 2908, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/render3/jit_environment_spec.ts" }
angular/packages/core/test/render3/is_shape_of.ts_0_4883
/** * @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 {TI18n, TIcu} from '@angular/core/src/render3/interfaces/i18n'; import {TNode} from '@angular/core/src/render...
{ "end_byte": 4883, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/render3/is_shape_of.ts" }
angular/packages/core/test/render3/multi_map_spec.ts_0_1628
/** * @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 {UniqueValueMultiKeyMap} from '@angular/core/src/render3/list_reconciliation'; describe('MultiMap', () => { ...
{ "end_byte": 1628, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/render3/multi_map_spec.ts" }
angular/packages/core/test/render3/matchers_spec.ts_0_3877
/** * @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 {createTNode, createTView} from '@angular/core/src/render3/instructions/shared'; import {TNodeType} from '@an...
{ "end_byte": 3877, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/render3/matchers_spec.ts" }
angular/packages/core/test/render3/matchers.ts_0_7600
/** * @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 {I18nDebug, IcuCreateOpCodes, TI18n, TIcu} from '@angular/core/src/render3/interfaces/i18n'; import {TNode} f...
{ "end_byte": 7600, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/render3/matchers.ts" }
angular/packages/core/test/render3/instructions_spec.ts_0_1347
/** * @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 {CommonModule} from '@angular/common'; import {Component, Input} from '@angular/core/public_api'; import {ngD...
{ "end_byte": 1347, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages/core/test/render3/instructions_spec.ts" }