Pasta: fa5ea437b2b6699a11b147612bef4f172dccc1d0 (2014-08-10)

Język: JavaScript
Adres: p43.pl/p,fa5ea437b2b6699a11b147612bef4f172dccc1d0
Ilość linii: 21
Rozmiar: 0.71 kB
Wyświetleń: 431
Ostatnio użyto: 2017-09-13 00:17:03
App = Ember.Application.create(); Ember.Binding.uppercase = function(path) { return this.from(path).transform(function(value) { return (Ember.typeOf(value) === 'string') ? value.toUpperCase() : value; }); }; App.obj = Ember.ArrayProxy.create({ content: [], uppercaseValueBinding: Ember.Binding.uppercase('value'), setSync: function(property, value) { this.set(property, value); Ember.run.sync(); // synchronize bindings this.pushObject('value = %@ ; uppercaseValue = %@'.fmt(this.get('value'), this.get('uppercaseValue'))); } }); App.obj.setSync('value', 'hello'); App.obj.setSync('uppercaseValue', 'This Works Too'); App.obj.setSync('value', 'buster');