Skip to content

Ivy: binding to [style.opacity] with a value of 0 is broken #31345

@fr0

Description

@fr0

🐞 bug report

Affected Package

The issue is caused by package @angular/core

Is this a regression?

Yes, it works in non-ivy.

Description

@Component({
  selector: 'app-test',
  template: `
    <label [style.opacity]="opacity">
      This has an opacity binding, and should not be visible
    </label>
  `
})
export class MyComponent {
  opacity = 0;
}

Reproducible repo: https://github.com/fr0/angular-test

🌍 Your Environment

Angular Version:

Angular CLI: 8.1.0-rc.0
Node: 12.4.0
OS: darwin x64
Angular: 8.1.0-rc.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.801.0-rc.0
@angular-devkit/build-angular     0.801.0-rc.0
@angular-devkit/build-optimizer   0.801.0-rc.0
@angular-devkit/build-webpack     0.801.0-rc.0
@angular-devkit/core              8.1.0-rc.0
@angular-devkit/schematics        8.1.0-rc.0
@ngtools/webpack                  8.1.0-rc.0
@schematics/angular               8.1.0-rc.0
@schematics/update                0.801.0-rc.0
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.35.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions