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