aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMisko Hevery2010-02-09 13:13:18 -0800
committerMisko Hevery2010-02-09 13:13:18 -0800
commit799d72931a5a01de74bba69d8a6638cd57cec315 (patch)
treea8913e7a7322644c482ebff7471afa9d2e4f921d /src
parent9d566a0cd0225685efb192c195280b6857628d32 (diff)
downloadangular.js-799d72931a5a01de74bba69d8a6638cd57cec315.tar.bz2
added onUpdateView listener for config
Diffstat (limited to 'src')
-rw-r--r--src/Angular.js2
-rw-r--r--src/Binder.js2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/Angular.js b/src/Angular.js
index a7d4f719..93ca71b4 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -276,6 +276,7 @@ function exposeMethods(obj, methods){
function wireAngular(element, config) {
var widgetFactory = new WidgetFactory(config['server'], config['database']);
var binder = new Binder(element[0], widgetFactory, datastore, config['location'], config);
+ binder.updateListeners.push(config.onUpdateView);
var controlBar = new ControlBar(element.find('body'), config['server'], config['database']);
var onUpdate = function(){binder.updateView();};
var server = config['database'] =="$MEMORY" ?
@@ -358,6 +359,7 @@ angular['compile'] = function(element, config) {
jQuery = window['jQuery'];
msie = jQuery['browser']['msie'];
config = _({
+ 'onUpdateView': noop,
'server': "",
'location': {'get':noop, 'set':noop, 'listen':noop}
}).extend(config||{});
diff --git a/src/Binder.js b/src/Binder.js
index 8dac934b..4699a601 100644
--- a/src/Binder.js
+++ b/src/Binder.js
@@ -99,7 +99,7 @@ Binder.prototype = {
scope.updateView();
var end = new Date().getTime();
this.updateAnchor();
- _.each(this.updateListeners, function(fn) {fn();});
+ foreach(this.updateListeners, function(fn) {fn();});
},
docFindWithSelf: function(exp){