aurelia / aurelia/binding

parsing of template issue: ${moment().toISOString()} does not work

Open
#760 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
110
Forks
98
PR merge metrics
No merged PRs in 30d

Description

i get this error after upgrading

aurelia-framework version "aurelia-framework": "^1.3.1",

the view-model code:
```
import moment from 'moment'

export class ComponentX {
constructor (router) {
this.router = router
this.moment = moment
}
```

then in view.html:
`${moment()}` -- works, return date as string
`${moment().toISOString()}` -- does not work. no method of moment can be called, it throws error:
`moment() is not a function`

when i downgrade to "aurelia-framework": "1.3.0" it works again.

Contributor guide

Open the contributing guide

Research direction

Reproduce the template expression in view.html with aurelia-framework 1.3.1, comparing it with 1.3.0 and the shown view-model code. Trace how the binding parser handles moment() versus moment().toISOString(); done means method calls work again in the template without regressing the simpler expression.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.