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

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

Issue 1058283006: Update pubspecs and dependencies to get pkgbuild tests working. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
deleted file mode 100644
index c2c4427f740bb3fef5325bc222208d7e6b11bb28..0000000000000000000000000000000000000000
--- a/third_party/pkg/angular/lib/directive/ng_form.dart
+++ /dev/null
@@ -1,106 +0,0 @@
-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',
- publishTypes : const <Type>[NgControl],
- visibility: NgDirective.CHILDREN_VISIBILITY)
-@NgDirective(
- selector: 'fieldset',
- publishTypes : const <Type>[NgControl],
- visibility: NgDirective.CHILDREN_VISIBILITY)
-@NgDirective(
- selector: '.ng-form',
- publishTypes : const <Type>[NgControl],
- visibility: NgDirective.CHILDREN_VISIBILITY)
-@NgDirective(
- selector: '[ng-form]',
- publishTypes : const <Type>[NgControl],
- visibility: NgDirective.CHILDREN_VISIBILITY)
-class NgForm extends NgControl implements Map<String, NgControl> {
- /**
- * Instantiates a new instance of NgForm. Upon creation, the instance of the
- * class will be bound to the formName property on the scope (where formName
- * refers to the name value acquired from the name attribute present on the
- * form DOM element).
- *
- * * [scope] - The scope to bind the form instance to.
- * * [element] - The form DOM element.
- * * [injector] - An instance of Injector.
- */
- NgForm(Scope scope, dom.Element element, Injector injector) :
- super(scope, element, injector) {
-
- if (!element.attributes.containsKey('action')) {
- element.onSubmit.listen((event) {
- event.preventDefault();
- _scope.broadcast('submitNgControl', valid == null ? false : valid);
- reset();
- });
- }
- }
-
- @NgAttr('name')
- get name => _name;
- set name(value) {
- super.name = value;
- _scope.context[name] = this;
- }
-
- //FIXME: fix this reflection bug that shows up when Map is implemented
- operator []=(String key, value) {
- if (key == 'name') {
- name = value;
- } else {
- _controlByName[key] = value;
- }
- }
-
- //FIXME: fix this reflection bug that shows up when Map is implemented
- operator[](name) {
- if (name == 'valid') {
- return valid;
- } else if (name == 'invalid') {
- return invalid;
- } else {
- return _controlByName[name];
- }
- }
-
- bool get isEmpty => false;
- bool get isNotEmpty => !isEmpty;
- get values => null;
- get keys => null;
- get length => null;
- clear() => null;
- remove(_) => null;
- containsKey(_) => false;
- containsValue(_) => false;
- addAll(_) => null;
- forEach(_) => null;
- putIfAbsent(_, __) => null;
-}
-
-class NgNullForm extends NgNullControl implements NgForm {
- NgNullForm() {}
-
- operator[](name) {}
- operator []=(String name, value) {}
-
- bool get isEmpty => false;
- bool get isNotEmpty => true;
- get values => null;
- get keys => null;
- get length => null;
- clear() => null;
- remove(_) => null;
- containsKey(_) => false;
- containsValue(_) => false;
- addAll(_) => null;
- forEach(_) => null;
- putIfAbsent(_, __) => null;
-}
« no previous file with comments | « third_party/pkg/angular/lib/directive/ng_events.dart ('k') | third_party/pkg/angular/lib/directive/ng_if.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698