fix(ivy): unable to bind style zero (#32994)
Fixes not being able to bind zero as a value in style bindings. Fixes #32984. PR Close #32994
This commit is contained in:

committed by
Alex Rickabaugh

parent
c61e4d7841
commit
3efb060127
@ -165,6 +165,20 @@ describe('styling', () => {
|
||||
expect(fixture.nativeElement.innerHTML).toBe('<div></div>');
|
||||
});
|
||||
|
||||
it('should be able to bind zero', () => {
|
||||
@Component({template: '<div #div [style.opacity]="opacity"></div>'})
|
||||
class App {
|
||||
@ViewChild('div') div !: ElementRef<HTMLElement>;
|
||||
opacity = 0;
|
||||
}
|
||||
|
||||
TestBed.configureTestingModule({declarations: [App]});
|
||||
const fixture = TestBed.createComponent(App);
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(fixture.componentInstance.div.nativeElement.style.opacity).toBe('0');
|
||||
});
|
||||
|
||||
it('should be able to bind a SafeValue to backgroundImage', () => {
|
||||
@Component({template: '<div [style.backgroundImage]="image"></div>'})
|
||||
class Cmp {
|
||||
|
Reference in New Issue
Block a user