aurelia / aurelia/templating-binding

Custom attribute options binding breaks if interpolation is used

Open
#136 4 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
30
Forks
26
PR merge metrics
No merged PRs in 30d

Description

**I'm submitting a bug report**

* **Library Version:**
aurelia-bootstrapper@2.3.2
aurelia-templating-binding@1.5.3
aurelia-binding@2.2.1

* **JSPM OR Webpack AND Version**
Webpack 4.28.3

* **Browser:**
Chrome 73 | Safari 12 | ...

**Current behavior:**

Let's assume I have a custom attribute `foo` with a bindable property `path` of type string.

This works - meaning that the bindable property is set to the value of `someProperty`:
```html


```

This **does not** work - meaning that the bindable property is never set and remains undefined:
```html


```

**Expected/desired behavior:**

* **What is the expected behavior?**

I expected the `path` property to be set to the same value in both cases - and I most certainly didn't expect it to remain undefined when bound using the second approach.

Shouldn't this work?

* **What is the motivation / use case for changing the behavior?**

In the examples above, the first approach is of course the cleanest anyway.
However, when binding something like a path containing a dynamic segment, the second approach would be cleaner - and it is certainly something one would expect to just work:
```html


```

Contributor guide

Open the contributing guide

Research direction

Reproduce the two custom-attribute bindings from issue #136 with the reported Aurelia package versions and Webpack 4.28.3. Trace how the `path` bindable is handled for `path.bind: someProperty` versus `path: ${someProperty}`; done means both forms assign the expected value, including a dynamic path segment.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.