fixup! feat(ivy): adding support for ngNonBindable attribute

This commit is contained in:
Andrew Kushnir 2018-09-26 16:02:40 -07:00 committed by Alex Rickabaugh
parent 0ed2df2a36
commit add1198b88
2 changed files with 19 additions and 3 deletions

View File

@ -218,8 +218,25 @@ describe('compiler compliance: bindings', () => {
}
`;
const result = compile(files, angularFiles);
expectEmit(result.source, template, 'Incorrect handling of local refs for nested elements');
expectEmit(result.source, template, 'Incorrect handling of property bindings and listeners');
});
it('should not generate extra instructions for elements with no children', () => {
const files: MockDirectory = getAppFiles(`
<div ngNonBindable></div>
`);
const template = `
template:function MyComponent_Template(rf, $ctx$){
if (rf & 1) {
$i0$.ɵelement(0, "div");
}
}
`;
const result = compile(files, angularFiles);
expectEmit(result.source, template, 'Incorrect handling of elements with no children');
});
});
});

View File

@ -7,13 +7,12 @@
*/
import {ElementRef, TemplateRef, ViewContainerRef} from '@angular/core';
import {RenderFlags} from '@angular/core/src/render3';
import {RendererStyleFlags2, RendererType2} from '../../src/render/api';
import {AttributeMarker, defineComponent, defineDirective} from '../../src/render3/index';
import {NO_CHANGE, bind, container, containerRefreshEnd, containerRefreshStart, element, elementAttribute, elementClassProp, elementContainerEnd, elementContainerStart, elementEnd, elementProperty, elementStart, elementStyleProp, elementStyling, elementStylingApply, embeddedViewEnd, embeddedViewStart, setBindingsEnabled, setBindingsDisabled, interpolation1, interpolation2, interpolation3, interpolation4, interpolation5, interpolation6, interpolation7, interpolation8, interpolationV, listener, load, loadDirective, projection, projectionDef, reference, text, textBinding, template} from '../../src/render3/instructions';
import {InitialStylingFlags} from '../../src/render3/interfaces/definition';
import {InitialStylingFlags, RenderFlags} from '../../src/render3/interfaces/definition';
import {RElement, Renderer3, RendererFactory3, domRendererFactory3, RText, RComment, RNode, RendererStyleFlags3, ProceduralRenderer3} from '../../src/render3/interfaces/renderer';
import {HEADER_OFFSET, CONTEXT, DIRECTIVES} from '../../src/render3/interfaces/view';
import {sanitizeUrl} from '../../src/sanitization/sanitization';