Skip to content

Commit

Permalink
refactor(ivy): harmonize container and element / elementContainer sig…
Browse files Browse the repository at this point in the history
…natures (angular#25458)

PR Close angular#25458
  • Loading branch information
pkozlowski-opensource authored and FrederikSchlemmer committed Jan 3, 2019
1 parent 2a846d0 commit 041ca93
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/render3/instructions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1838,8 +1838,8 @@ export function createLContainer(
* @param localRefs A set of local reference bindings on the element.
*/
export function container(
index: number, template?: ComponentTemplate<any>, tagName?: string | null, attrs?: TAttributes,
localRefs?: string[] | null): void {
index: number, template?: ComponentTemplate<any>| null, tagName?: string | null,
attrs?: TAttributes | null, localRefs?: string[] | null): void {
ngDevMode &&
assertEqual(
viewData[BINDING_INDEX], -1, 'container nodes should be created before any bindings');
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/render3/di_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ describe('di', () => {
/** <div *myIf="showing" dir dirSameInstance #dir="dir"> {{ dir.value }} </div> */
template: function(rf: RenderFlags, ctx: MyApp) {
if (rf & RenderFlags.Create) {
container(0, C1, undefined, ['myIf', 'showing']);
container(0, C1, null, ['myIf', 'showing']);
}
if (rf & RenderFlags.Update) {
containerRefreshStart(0);
Expand Down
16 changes: 8 additions & 8 deletions packages/core/test/render3/query_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ describe('query', () => {
'cmpt',
function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
container(1, undefined, undefined, undefined, ['foo', '']);
container(1, null, null, null, ['foo', '']);
}
},
[], [],
Expand Down Expand Up @@ -542,7 +542,7 @@ describe('query', () => {
'cmpt',
function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
container(1, undefined, undefined, undefined, ['foo', '']);
container(1, null, null, null, ['foo', '']);
}
},
[], [],
Expand Down Expand Up @@ -577,7 +577,7 @@ describe('query', () => {
'cmpt',
function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
container(1, undefined, undefined, undefined, ['foo', '']);
container(1, null, null, null, ['foo', '']);
}
},
[], [],
Expand Down Expand Up @@ -609,7 +609,7 @@ describe('query', () => {
'cmpt',
function(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
container(1, undefined, undefined, undefined, ['foo', '']);
container(1, null, null, null, ['foo', '']);
}
},
[], [],
Expand Down Expand Up @@ -1129,7 +1129,7 @@ describe('query', () => {
}
}, null, []);

container(5, undefined, null, [AttributeMarker.SelectOnly, 'vc']);
container(5, null, null, [AttributeMarker.SelectOnly, 'vc']);
}

if (rf & RenderFlags.Update) {
Expand Down Expand Up @@ -1221,8 +1221,8 @@ describe('query', () => {
}
}, null, []);

container(2, undefined, null, [AttributeMarker.SelectOnly, 'vc']);
container(3, undefined, null, [AttributeMarker.SelectOnly, 'vc']);
container(2, null, null, [AttributeMarker.SelectOnly, 'vc']);
container(3, null, null, [AttributeMarker.SelectOnly, 'vc']);
}

if (rf & RenderFlags.Update) {
Expand Down Expand Up @@ -1288,7 +1288,7 @@ describe('query', () => {
element(0, 'span', ['id', 'from_tpl'], ['foo', '']);
}
}, undefined, undefined, ['tpl', '']);
container(3, undefined, null, [AttributeMarker.SelectOnly, 'ngTemplateOutlet']);
container(3, null, null, [AttributeMarker.SelectOnly, 'ngTemplateOutlet']);
}
if (rf & RenderFlags.Update) {
const tplRef = getOrCreateTemplateRef(getOrCreateNodeInjectorForNode(load(1)));
Expand Down
10 changes: 5 additions & 5 deletions packages/core/test/render3/view_container_ref_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ describe('ViewContainerRef', () => {

it('should work on containers', () => {
function createTemplate() {
container(0, embeddedTemplate, undefined, ['vcref', '']);
container(0, embeddedTemplate, null, ['vcref', '']);
element(1, 'footer');
}

Expand Down Expand Up @@ -246,8 +246,8 @@ describe('ViewContainerRef', () => {
template: (rf: RenderFlags, cmp: TestComponent) => {
if (rf & RenderFlags.Create) {
text(0, 'before|');
container(1, EmbeddedTemplateA, undefined, ['testdir', '']);
container(2, EmbeddedTemplateB, undefined, ['testdir', '']);
container(1, EmbeddedTemplateA, null, ['testdir', '']);
container(2, EmbeddedTemplateB, null, ['testdir', '']);
text(3, '|after');
}
},
Expand Down Expand Up @@ -315,7 +315,7 @@ describe('ViewContainerRef', () => {
template: (rf: RenderFlags, cmp: TestComponent) => {
if (rf & RenderFlags.Create) {
text(0, 'before|');
container(1, EmbeddedTemplateA, undefined, ['testdir', '']);
container(1, EmbeddedTemplateA, null, ['testdir', '']);
container(2);
text(3, '|after');
}
Expand Down Expand Up @@ -1074,7 +1074,7 @@ describe('ViewContainerRef', () => {

it('should work on containers', () => {
function createTemplate() {
container(0, embeddedTemplate, undefined, ['vcref', '']);
container(0, embeddedTemplate, null, ['vcref', '']);
element(1, 'footer');
}

Expand Down

0 comments on commit 041ca93

Please sign in to comment.