**** BEGIN LOGGING AT Thu Nov 13 03:00:00 2014 Nov 13 14:33:26 * DougReeder waves hello Nov 13 14:34:00 * GodGinrai waves back Nov 13 14:34:16 For a 2-way binding, is there any event sent or hook for when the “to” end changes the value? Nov 13 14:34:54 there should be Nov 13 14:35:06 What do you need it for? Nov 13 14:35:19 hi guys Nov 13 14:35:24 I have the bingding {from: ".person.favorite", to: ".$.header.favorite", oneWay: false }, Nov 13 14:35:25 morning Semanticfire_2 Nov 13 14:35:49 … but when the “to” end changes it, personChanged is not called. Nov 13 14:36:07 DougReeder: that's not a bindings problem Nov 13 14:36:26 Should I use some favoriteChanged() method? Nov 13 14:36:35 DougReeder: yes. Nov 13 14:38:15 on PersonModel? Nov 13 14:39:15 DougReeder: I guess? I don't know your Kind structure. Nov 13 14:39:43 Alternatively, you could also attach an observer to person.favorite Nov 13 14:40:18 depending on what you are needing to do when person.favorite changes Nov 13 14:41:02 Since person is constantly being set, would I need to reestablish the observer every time? Nov 13 14:41:18 GodGinrai, its late afternoon here ;) Nov 13 14:41:37 Semanticfire_2: http://www.total-knowledge.com/~ilya/mips/ugt.html Nov 13 14:42:45 DougReeder: I believe they are like bindings and will just work whenever something is actually where they are pointing. (IIRC, Bindings just use observers to detect the changes in the first place) Nov 13 14:53:26 I’m not certain this is optimal, but this does what I asked: this.person.addObserver("favorite", function (oldFavorite, newFavorite, propChanged) { Nov 13 14:53:50 … which prsumably needs to be called every time person changes Nov 13 14:55:16 GodGinrai, nice, didn't know that one :) Nov 13 15:07:06 Semanticfire_2: yw ;) Nov 13 15:08:42 btw, is there a way in JS to include a JSON file programmatically? Or do I need to use XHR to load it? Nov 13 15:14:06 what do you mean ? Nov 13 15:15:52 Basically, I need to load some JSON that will be in the same directory structure as the code that's running. (same server, in other words) Nov 13 15:16:05 But I need to be able to choose when to load it Nov 13 15:16:11 and what particular files to load Nov 13 15:19:36 ah like that Nov 13 15:20:19 well if you need to get it from the server there is no other option Nov 13 15:20:26 since the browser needs to fetch it as well Nov 13 15:21:06 if the set of choices you want to choose from is static you might work with a variable and load all the scripts at once Nov 13 15:21:18 but its not json file then Nov 13 15:21:41 whats your issues with xhr ? Nov 13 15:21:50 The above works, but the observer needs to be added every time person changes. Currently, I’m trying { name: "header", kind: "ContactHeader", favoriteChanged: function (oldFavorite, newFavorite, header) { Nov 13 15:22:28 … that is, observe the other end. The header object doesn’t change, so the observer can be added once. Nov 13 15:22:46 DougReeder: if you just need something to key off of whenever it changes, why not use a transform function in the binding? Nov 13 15:23:32 Also a possibility, but that would be a side effect, and it seems wrong for transforms to have side effects. Nov 13 15:23:39 Semanticfire_2: My issue with XHR is that it is a lot of setup for what other languages accomplish with include(file) or require(file) Nov 13 15:24:29 * DougReeder shrugs “But that might be less smell than other techniques. Nov 13 15:25:06 DougReeder: Sure, technically a transform function should only transform the data, but it seems like the cleanest way to solve your problem (aside from writing in a changed method for your Person Model) Nov 13 15:25:08 GodGinrai, but other languages don't get it from a remote filesystem :) Nov 13 15:25:48 And the transform method knows which way the data is flowing. Nov 13 15:26:02 Semanticfire_2: Sure, but this is the same remote filesystem I already got the current files from. HTML can say it easy enough with