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

Custom attribute primary property same name as attribute #716

Open
plarner30 opened this issue Oct 12, 2020 · 4 comments
Open

Custom attribute primary property same name as attribute #716

plarner30 opened this issue Oct 12, 2020 · 4 comments

Comments

@plarner30
Copy link

I'm submitting a bug report
Windows 10
Chrome 85.0.4183.102

Current behaviour
If you name the primary property of a custom attribute the same as the attribute its is not possible to access the initial or changed value.

What is the expected behavior?
The value should update when the primary property name is the same as the attribute and have the correct initial value.

@customAttribute('permission')
@autoinject
export class PermissionCustomAttribute {
  @bindable({ primaryProperty: true }) permission: string= '';
   permissionChanged(newPermission: string) {
    console.log(newPermission);
  }
}
<div permission.bind="'test'"></div>
@bigopon
Copy link
Member

bigopon commented Oct 13, 2020

This should work fine. But I'm guessing you are using convention with default skeleton generated by the CLI? Can you confirm the following gist is what you are doing https://gist.dumber.app/?gist=72f268dbd59de49b8b34e346ddbceab2&open=src%2Fmain.js

@plarner30
Copy link
Author

Followed up on aurelia/Discuss as didnt fully understand CLI query. Thanks @bigopon, for cross reference purposes confirming this was actually related to https://discourse.aurelia.io/t/xy-in-bindable-for-custom-attribute/3805/4 which will be fixed soon.

@bigopon
Copy link
Member

bigopon commented Oct 16, 2020

@fkleuver this is v1 issue, please move it to templating

@Sayan751
Copy link
Member

@bigopon Can you please transfer this issue to v1 repo?

@bigopon bigopon transferred this issue from aurelia/aurelia Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants