perf(ivy): attempt rendering initial styling only if present (#32979)

PR Close #32979
This commit is contained in:
Pawel Kozlowski
2019-10-03 15:02:10 +02:00
committed by Alex Rickabaugh
parent e6881b5b42
commit 60047037a3
7 changed files with 44 additions and 15 deletions

View File

@ -113,6 +113,34 @@ describe('styling', () => {
expect(outer.textContent.trim()).toEqual('outer');
});
it('should render initial styling for repeated nodes that a component host', () => {
@Component({
selector: '[comp]',
template: '',
})
class Comp {
}
@Component({
template: `
<ng-template ngFor [ngForOf]="items" let-item>
<p comp class="a">A</p>
</ng-template>
`
})
class App {
items = [1, 2, 3];
}
TestBed.configureTestingModule({
declarations: [App, Comp],
});
const fixture = TestBed.createComponent(App);
fixture.detectChanges();
expect(fixture.debugElement.queryAll(By.css('.a')).length).toBe(3);
});
it('should do nothing for empty style bindings', () => {
@Component({template: '<div [style.color]></div>'})
class App {