Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using [attr.disabled] with no value errors in 2.1.1 #12583

Closed
filipesilva opened this issue Oct 27, 2016 · 3 comments
Closed

Using [attr.disabled] with no value errors in 2.1.1 #12583

filipesilva opened this issue Oct 27, 2016 · 3 comments
Labels

Comments

@filipesilva
Copy link
Contributor

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
Using [attr.disabled] with no value causes a runtime error on 2.1.2, whereas it did not on 2.1.1

For instance, <h2 [attr.disabled]>Hello {{name}}</h2> results in:

Unhandled Promise rejection: Cannot read property 'currValExpr' of null ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot read property 'currValExpr' of null(…) TypeError: Cannot read property 'currValExpr' of null

Expected behavior
Did not expect runtime error on a patch version update where there was no runtime error before.

Minimal reproduction of the problem with instructions
http://plnkr.co/edit/hWsxGPBSGF0z58R1A5Uy?p=preview

Please tell us about your environment:
Plunker

  • Angular version: 2.1.2
  • Browser: [Chrome 54]
  • Language: [TypeScript 2.0.3]

/cc @vicb

@vicb
Copy link
Contributor

vicb commented Oct 28, 2016

@tbosch

We have a clear error message when events are bound to undefined:

Empty expressions are not allowed ("
    <div>
      <h2 [ERROR ->](click)>Hello {{name}}</h2>
    </div>
  "): App@2:10 ; Zone: <root> ; Task: Promise.then ; Value: Error: Template parse errors:(…) Error: Template parse errors:
Empty expressions are not allowed ("
    <div>
      <h2 [ERROR ->](click)>Hello {{name}}</h2>
    </div>
  "): App@2:10

Do we want to do the same here or assume null/undefined ?

@tbosch
Copy link
Contributor

tbosch commented Oct 28, 2016

Let's do this later. For now I will just fall back to the old behavior of ignoring these cases.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants