Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(759)

Unified Diff: third_party/pkg/angular/lib/directive/ng_form.dart

Issue 124053002: Adding Angular and dependent packages for testing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/pkg/angular/lib/directive/ng_form.dart
diff --git a/third_party/pkg/angular/lib/directive/ng_form.dart b/third_party/pkg/angular/lib/directive/ng_form.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5fc228590fbcd567c6089638b2cd732dc80f2a07
--- /dev/null
+++ b/third_party/pkg/angular/lib/directive/ng_form.dart
@@ -0,0 +1,22 @@
+part of angular.directive;
+
+/**
+ * The form directive listens on submission requests and, depending,
+ * on if an action is set, the form will automatically either allow
+ * or prevent the default browser submission from occurring.
+ */
+@NgDirective(
+ selector: 'form',
+ visibility: NgDirective.CHILDREN_VISIBILITY)
+class NgForm {
+ dom.Element _element;
+ Scope _scope;
+
+ NgForm(this._scope, this._element) {
+ if(!this._element.attributes.containsKey('action')) {
+ this._element.onSubmit.listen((event) {
+ event.preventDefault();
+ });
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698