@ -8,12 +8,11 @@
|
||||
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {Component, ContentChild, NgModule, TemplateRef, Type, ViewChild, ViewContainerRef} from '@angular/core';
|
||||
import {ComponentFixture, TestBed, fakeAsync, tick} from '@angular/core/testing';
|
||||
import {ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing';
|
||||
import {Router} from '@angular/router';
|
||||
import {RouterTestingModule} from '@angular/router/testing';
|
||||
|
||||
describe('Integration', () => {
|
||||
|
||||
describe('routerLinkActive', () => {
|
||||
it('should not cause infinite loops in the change detection - #15825', fakeAsync(() => {
|
||||
@Component({selector: 'simple', template: 'simple'})
|
||||
@ -73,16 +72,18 @@ describe('Integration', () => {
|
||||
})
|
||||
class ComponentWithRouterLink {
|
||||
// TODO(issue/24571): remove '!'.
|
||||
@ViewChild(TemplateRef, {static: true}) templateRef !: TemplateRef<any>;
|
||||
@ViewChild(TemplateRef, {static: true}) templateRef!: TemplateRef<any>;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
@ViewChild('container', {read: ViewContainerRef, static: true})
|
||||
container !: ViewContainerRef;
|
||||
container!: ViewContainerRef;
|
||||
|
||||
addLink() {
|
||||
this.container.createEmbeddedView(this.templateRef, {$implicit: '/simple'});
|
||||
}
|
||||
|
||||
removeLink() { this.container.clear(); }
|
||||
removeLink() {
|
||||
this.container.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@Component({template: 'simple'})
|
||||
@ -108,9 +109,7 @@ describe('Integration', () => {
|
||||
|
||||
expect(fixture.nativeElement.innerHTML).toContain('isActive: false');
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function advance<T>(fixture: ComponentFixture<T>): void {
|
||||
|
Reference in New Issue
Block a user