]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | Ext.define('KitchenSink.view.binding.FormulaModel', {\r |
2 | extend: 'Ext.app.ViewModel',\r | |
3 | alias: 'viewmodel.binding-formula',\r | |
4 | \r | |
5 | formulas: {\r | |
6 | quad: function (get) {\r | |
7 | return get('twice') * 2;\r | |
8 | },\r | |
9 | \r | |
10 | // This accomplishes the same thing as above but using object syntax.\r | |
11 | twice: {\r | |
12 | get: function (get) {\r | |
13 | return get('x') * 2;\r | |
14 | }\r | |
15 | }\r | |
16 | },\r | |
17 | \r | |
18 | data: {\r | |
19 | x: 1\r | |
20 | }\r | |
21 | }); |