Skip to content

[attr.width.px] can't work in angular9 #36256

Closed

Description

@DreamLi1314

Env

  • os: win10
  • browser: Chrome 80.0.3987.149(x64)
  • package.json
    "@angular/animations": "^9.0.7",
    "@angular/cdk": "^9.1.3",
    "@angular/common": "^9.0.7",
    "@angular/compiler": "^9.0.7",
    "@angular/core": "^9.0.7",
    "@angular/forms": "^9.0.7",
    "@angular/localize": "^9.0.7",
    "@angular/material": "^9.1.3",
    "@angular/material-moment-adapter": "^9.1.3",
    "@angular/platform-browser": "^9.0.7",
    "@angular/platform-browser-dynamic": "^9.0.7",
    "@angular/router": "^9.0.7"

Desc

<td *ngIf="hasContent(r, c)"
    [attr.width.px]="model?.cells[r][c]?.width"
    [attr.height.px]="model?.cells[r][c]?.height + (isEditableMode() && last ? 1 : 0)"

Browser Display

Rendering failed because the property was compiled to width.px

Activity

  1. pkozlowski-opensource commented on May 11, 2020

    @pkozlowski-opensource
    Member

    Thinking about it a bit more, I would say that, as the very minimum, we should have compile-time error when encountering [attr.width.px] syntax (that is, we should verify that the attribute binding syntax comes only in the [attr.attrname] flavour and is not accepting suffix.

  2. added
    P4A relatively minor issue that is not relevant to core functions
    and removed on Oct 1, 2020
  3. vikassrivastava18 commented on Feb 27, 2021

    @vikassrivastava18

    Not working in Angular 11

    [style.width.px]="expression"
    
  4. self-assigned this
    on Jun 28, 2022
  5. angular-automatic-lock-bot commented on Aug 8, 2022

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  6. locked and limited conversation to collaborators on Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions