Custom attribute primary property same name as attribute
- Dominant language
- TypeScript
- Stars
- 113
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
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);
}
}
```
```
```
Contributor guide
Research direction
Start by reproducing the custom attribute example using @customAttribute('permission'), a primary bindable property named permission, and permission.bind="'test'". Trace how the templating engine resolves the primary property and permissionChanged callback, then verify that both the initial value and later changes are available when the names match.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100