From e0c88ccdbcf4d0d31e4ad94ecde1c8b4ad22b5c4 Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Thu, 19 Nov 2015 12:29:41 +0100 Subject: [PATCH] Phi: add helper makeObservablesForAllProperties call ko.utils.knockprops.makeObservablesForAllProperties( self ); to create an observable() for every bridged property --- Phi/lib/knockprops.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Phi/lib/knockprops.js b/Phi/lib/knockprops.js index 8ff0e8d34..645d86b2e 100644 --- a/Phi/lib/knockprops.js +++ b/Phi/lib/knockprops.js @@ -175,6 +175,16 @@ define(['knockout'], function(ko) { } } + self.makeObservablesForAllProperties = function(target) { + for( var p in self.aliases ) { + if( self.aliases.hasOwnProperty(p) ) { + target[p] = ko.observable().extend({ + fgprop : p + }); + } + } + } + self.props = {}; self.get = function(target, prop) {