diff options
| author | Misko Hevery | 2010-02-09 13:13:18 -0800 |
|---|---|---|
| committer | Misko Hevery | 2010-02-09 13:13:18 -0800 |
| commit | 799d72931a5a01de74bba69d8a6638cd57cec315 (patch) | |
| tree | a8913e7a7322644c482ebff7471afa9d2e4f921d /src | |
| parent | 9d566a0cd0225685efb192c195280b6857628d32 (diff) | |
| download | angular.js-799d72931a5a01de74bba69d8a6638cd57cec315.tar.bz2 | |
added onUpdateView listener for config
Diffstat (limited to 'src')
| -rw-r--r-- | src/Angular.js | 2 | ||||
| -rw-r--r-- | src/Binder.js | 2 |
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){ |
