NativeScript/NativeScript

Can not use nested object method in expression for binding

Open

#6727 opened on Dec 19, 2018

View on GitHub
 (6 comments) (0 reactions) (0 assignees)TypeScript (23,592 stars) (1,634 forks)batch import
featuregood first issue

Description

Environment

  • CLI: 5.0.1
  • Cross-platform modules: 5.0.5
  • Android Runtime: 5.0.0
  • iOS Runtime: not installed

To Reproduce

class ViewModel extends Observable {
    public obj = {
        fun: function () {
            return "It's fun()"
        }
    }
}

const vm = new ViewModel();
<Label text="{{ obj.fun() }}"/>
Binding: Run-time error occured in file: undefined at line: undefined and column: undefined

Same result if it used, as ListView item bindingContext.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Contributor guide