aboutsummaryrefslogtreecommitdiffstats
path: root/src/widgets.js
diff options
context:
space:
mode:
authorAndres Ornelas2010-08-04 11:45:42 -0700
committerAndres Ornelas2010-08-04 11:45:42 -0700
commitec12285c9d213a50b86b2ff8d968686acd6d1693 (patch)
tree94c0792946bfa461c4fab525b3758b06c6da9f9f /src/widgets.js
parentef88eb9a71ee7666029c4fb5eb731ce2e986cecc (diff)
parent89245f3a527415a80d46b37054b558454c314532 (diff)
downloadangular.js-ec12285c9d213a50b86b2ff8d968686acd6d1693.tar.bz2
Merge branch 'master' of github.com:angular/angular.js into future
Diffstat (limited to 'src/widgets.js')
-rw-r--r--src/widgets.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets.js b/src/widgets.js
index 5f0fcf7c..87a302fa 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -198,14 +198,15 @@ function inputWidget(events, modelAccessor, viewAccessor, initFn) {
this.$eval(element.attr('ng:init')||'');
// Don't register a handler if we are a button (noopAccessor) and there is no action
if (action || modelAccessor !== noopAccessor) {
- element.bind(events, function(){
+ element.bind(events, function(event){
model.set(view.get());
lastValue = model.get();
scope.$tryEval(action, element);
scope.$root.$eval();
// if we have noop initFn than we are just a button,
// therefore we want to prevent default action
- return initFn != noop;
+ if(initFn == noop)
+ event.preventDefault();
});
}
view.set(lastValue = model.get());