aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/directives.js3
-rw-r--r--src/widget/form.js4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/directives.js b/src/directives.js
index ea09fc06..54469ea7 100644
--- a/src/directives.js
+++ b/src/directives.js
@@ -524,9 +524,8 @@ angularDirective("ng:click", function(expression, element){
angularDirective("ng:submit", function(expression, element) {
return function(element) {
var self = this;
- element.bind('submit', function(event) {
+ element.bind('submit', function() {
self.$apply(expression);
- event.preventDefault();
});
};
});
diff --git a/src/widget/form.js b/src/widget/form.js
index 51864cf0..76051832 100644
--- a/src/widget/form.js
+++ b/src/widget/form.js
@@ -61,8 +61,8 @@ angularWidget('form', function(form){
parentForm = $formFactory.forElement(formElement),
form = $formFactory(parentForm);
formElement.data('$form', form);
- formElement.bind('submit', function(event){
- event.preventDefault();
+ formElement.bind('submit', function(event) {
+ if (!formElement.attr('action')) event.preventDefault();
});
if (name) {
this[name] = form;