Skip to content

buggy behaviour for non bound "attr.xxx-non-native" #12016

@tiagoroldao

Description

@tiagoroldao

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
When using the attribute binding (attr.xxx), no error is thrown but the attribut is badly parsed

As expected: <a [attr.test-id]="'my-test-id'"></a> => <a test-id="my-test-id"></a>
Not as expected: <a attr.test-id="my-test-id"></a> => <a attr.test-id="my-test-id"></a>

Expected behavior
Both examples should yield the same result:
<a [attr.test-id]="'my-test-id'"></a> => <a test-id="my-test-id"></a>
<a attr.test-id="my-test-id"></a> => <a test-id="my-test-id"></a>

Or the latter should be considered incorrect usage. I believe this second usage was at least at some point valid.

(of course, this is relevant because using <el test-id="my-test-id"/> with non native, non bound properties is not allowed)

Reproduction of the problem
http://plnkr.co/edit/ktOfndION5KQr3aCUcWy?p=preview

What is the motivation / use case for changing the behavior?
Clear behaviour important for users searching how to approach this
Bind-less option terser, and oftentimes binding isn't necessary

Please tell us about your environment:
OSX

  • Angular version: 2.0.0

  • Browser: Chrome

  • Language: TypeScript 2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions