fix(ivy): don't cache render parent on LContainer to support ngUpgrade (#28011)
PR Close #28011
This commit is contained in:
parent
1f904bffbc
commit
6beeb76ac0
@ -52,9 +52,9 @@ export function getLContainer(tNode: TViewNode, embeddedView: LView): LContainer
|
|||||||
* Retrieves render parent for a given view.
|
* Retrieves render parent for a given view.
|
||||||
* Might be null if a view is not yet attached to any container.
|
* Might be null if a view is not yet attached to any container.
|
||||||
*/
|
*/
|
||||||
export function getContainerRenderParent(tViewNode: TViewNode, view: LView): RElement|null {
|
function getContainerRenderParent(tViewNode: TViewNode, view: LView): RElement|null {
|
||||||
const container = getLContainer(tViewNode, view);
|
const container = getLContainer(tViewNode, view);
|
||||||
return container ? container[RENDER_PARENT] : null;
|
return container ? nativeParentNode(view[RENDERER], container[NATIVE]) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const enum WalkTNodeTreeAction {
|
const enum WalkTNodeTreeAction {
|
||||||
|
@ -2134,16 +2134,13 @@ withEachNg1Version(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('transclusion', () => {
|
describe('transclusion', () => {
|
||||||
fixmeIvy(`FW-863: Error: Failed to execute 'insertBefore' on 'Node'`)
|
it('should support single-slot transclusion', async(() => {
|
||||||
.it('should support single-slot transclusion', async(() => {
|
|
||||||
let ng2ComponentAInstance: Ng2ComponentA;
|
let ng2ComponentAInstance: Ng2ComponentA;
|
||||||
let ng2ComponentBInstance: Ng2ComponentB;
|
let ng2ComponentBInstance: Ng2ComponentB;
|
||||||
|
|
||||||
// Define `ng1Component`
|
// Define `ng1Component`
|
||||||
const ng1Component: angular.IComponent = {
|
const ng1Component:
|
||||||
template: 'ng1(<div ng-transclude></div>)',
|
angular.IComponent = {template: 'ng1(<div ng-transclude></div>)', transclude: true};
|
||||||
transclude: true
|
|
||||||
};
|
|
||||||
|
|
||||||
// Define `Ng1ComponentFacade`
|
// Define `Ng1ComponentFacade`
|
||||||
@Directive({selector: 'ng1'})
|
@Directive({selector: 'ng1'})
|
||||||
@ -2171,8 +2168,7 @@ withEachNg1Version(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Define `ng1Module`
|
// Define `ng1Module`
|
||||||
const ng1Module =
|
const ng1Module = angular.module('ng1Module', [])
|
||||||
angular.module('ng1Module', [])
|
|
||||||
.component('ng1', ng1Component)
|
.component('ng1', ng1Component)
|
||||||
.directive('ng2A', downgradeComponent({component: Ng2ComponentA}));
|
.directive('ng2A', downgradeComponent({component: Ng2ComponentA}));
|
||||||
|
|
||||||
@ -2530,8 +2526,7 @@ withEachNg1Version(() => {
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
fixmeIvy(`FW-863: Error: Failed to execute 'insertBefore' on 'Node'`)
|
it('should support structural directives in transcluded content', async(() => {
|
||||||
.it('should support structural directives in transcluded content', async(() => {
|
|
||||||
let ng2ComponentInstance: Ng2Component;
|
let ng2ComponentInstance: Ng2Component;
|
||||||
|
|
||||||
// Define `ng1Component`
|
// Define `ng1Component`
|
||||||
@ -2570,8 +2565,7 @@ withEachNg1Version(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Define `ng1Module`
|
// Define `ng1Module`
|
||||||
const ng1Module =
|
const ng1Module = angular.module('ng1Module', [])
|
||||||
angular.module('ng1Module', [])
|
|
||||||
.component('ng1', ng1Component)
|
.component('ng1', ng1Component)
|
||||||
.directive('ng2', downgradeComponent({component: Ng2Component}));
|
.directive('ng2', downgradeComponent({component: Ng2Component}));
|
||||||
|
|
||||||
@ -2590,22 +2584,19 @@ withEachNg1Version(() => {
|
|||||||
const element = html(`<ng2></ng2>`);
|
const element = html(`<ng2></ng2>`);
|
||||||
|
|
||||||
bootstrap(platformBrowserDynamic(), Ng2Module, element, ng1Module).then(adapter => {
|
bootstrap(platformBrowserDynamic(), Ng2Module, element, ng1Module).then(adapter => {
|
||||||
expect(multiTrim(element.textContent, true))
|
expect(multiTrim(element.textContent, true)).toBe('ng2(ng1(x(foo1)|default(bar2)))');
|
||||||
.toBe('ng2(ng1(x(foo1)|default(bar2)))');
|
|
||||||
|
|
||||||
ng2ComponentInstance.x = 'baz';
|
ng2ComponentInstance.x = 'baz';
|
||||||
ng2ComponentInstance.y = 'qux';
|
ng2ComponentInstance.y = 'qux';
|
||||||
ng2ComponentInstance.show = false;
|
ng2ComponentInstance.show = false;
|
||||||
$digest(adapter);
|
$digest(adapter);
|
||||||
|
|
||||||
expect(multiTrim(element.textContent, true))
|
expect(multiTrim(element.textContent, true)).toBe('ng2(ng1(x(baz2)|default(qux1)))');
|
||||||
.toBe('ng2(ng1(x(baz2)|default(qux1)))');
|
|
||||||
|
|
||||||
ng2ComponentInstance.show = true;
|
ng2ComponentInstance.show = true;
|
||||||
$digest(adapter);
|
$digest(adapter);
|
||||||
|
|
||||||
expect(multiTrim(element.textContent, true))
|
expect(multiTrim(element.textContent, true)).toBe('ng2(ng1(x(baz1)|default(qux2)))');
|
||||||
.toBe('ng2(ng1(x(baz1)|default(qux2)))');
|
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user