This is a migrated thread and some comments may be shown as answers.

Issue with ObservableObject and ECMAScript 5 get/set feature

2 Answers 101 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Olivier
Top achievements
Rank 1
Olivier asked on 30 Dec 2013, 08:26 PM
Hello Kendo team!

I'm facing an issue when I try to use ES5 get/set functions within an ObservableObject. Please check this JSBin for details. I was expecting to be invoke get or set functions on my observable object. However, apparently those functions are not recognized as part of the object structure.

Any clues about this problem?

Thanks!

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 31 Dec 2013, 07:38 AM
Hi,

Currently the extend method doesn't copy the ES5 getters and setters. You can however use Object.defineProperty like this: http://jsbin.com/AsinUjU/1/edit

Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Olivier
Top achievements
Rank 1
answered on 31 Dec 2013, 06:36 PM
Object.defineProperty made the trick!

Thank you so much and Happy New Year!
Tags
MVVM
Asked by
Olivier
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Olivier
Top achievements
Rank 1
Share this question
or