refactor(ivy): insert embedded views immediately (#24629)

PR Close #24629
This commit is contained in:
Marc Laval
2018-06-22 15:37:38 +02:00
committed by Miško Hevery
parent 6e20e0aac8
commit f229449c67
7 changed files with 171 additions and 81 deletions

View File

@ -57,10 +57,10 @@
"name": "RENDERER"
},
{
"name": "ROOT_DIRECTIVE_INDICES"
"name": "RENDER_PARENT"
},
{
"name": "SANITIZER"
"name": "ROOT_DIRECTIVE_INDICES"
},
{
"name": "TVIEW"
@ -156,7 +156,7 @@
"name": "firstTemplatePass"
},
{
"name": "getCurrentSanitizer"
"name": "getChildLNode"
},
{
"name": "getDirectiveInstance"

View File

@ -83,6 +83,9 @@
{
"name": "RENDERER"
},
{
"name": "RENDER_PARENT"
},
{
"name": "ROOT_DIRECTIVE_INDICES"
},
@ -335,6 +338,9 @@
{
"name": "generatePropertyAliases"
},
{
"name": "getChildLNode"
},
{
"name": "getCleanup"
},

View File

@ -261,6 +261,11 @@ describe('ViewContainerRef', () => {
insertTpl(ctx: {}) { this._vcRef.createEmbeddedView(this._tplRef, ctx); }
insertTpl2(ctx: {}) {
const viewRef = this._tplRef.createEmbeddedView(ctx);
this._vcRef.insert(viewRef);
}
remove(index?: number) { this._vcRef.remove(index); }
}
@ -327,7 +332,7 @@ describe('ViewContainerRef', () => {
fixture.update();
expect(fixture.html).toEqual('before|A|after');
directiveInstance !.insertTpl({});
directiveInstance !.insertTpl2({});
expect(fixture.html).toEqual('before|AA|after');
fixture.component.condition = true;