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

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

Issue 148453003: Updating Angular version (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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_control.dart
diff --git a/third_party/pkg/angular/lib/directive/ng_control.dart b/third_party/pkg/angular/lib/directive/ng_control.dart
new file mode 100644
index 0000000000000000000000000000000000000000..47cfc208b7b6ad8bbda15cb412973195e514cb00
--- /dev/null
+++ b/third_party/pkg/angular/lib/directive/ng_control.dart
@@ -0,0 +1,56 @@
+part of angular.directive;
+
+abstract class NgControl {
+ static const NG_VALID_CLASS = "ng-valid";
+ static const NG_INVALID_CLASS = "ng-invalid";
+ static const NG_PRISTINE_CLASS = "ng-pristine";
+ static const NG_DIRTY_CLASS = "ng-dirty";
+
+ String _name;
+ bool _dirty;
+ bool _pristine;
+ bool _valid;
+ bool _invalid;
+
+ get element => null;
+
+ get name => _name;
+ set name(name) => _name = name;
+
+ get pristine => _pristine;
+ set pristine(value) {
+ _pristine = true;
+ _dirty = false;
+
+ element.classes.remove(NG_DIRTY_CLASS);
+ element.classes.add(NG_PRISTINE_CLASS);
+ }
+
+ get dirty => _dirty;
+ set dirty(value) {
+ _dirty = true;
+ _pristine = false;
+
+ element.classes.remove(NG_PRISTINE_CLASS);
+ element.classes.add(NG_DIRTY_CLASS);
+ }
+
+ get valid => _valid;
+ set valid(value) {
+ _invalid = false;
+ _valid = true;
+
+ element.classes.remove(NG_INVALID_CLASS);
+ element.classes.add(NG_VALID_CLASS);
+ }
+
+ get invalid => _invalid;
+ set invalid(value) {
+ _valid = false;
+ _invalid = true;
+
+ element.classes.remove(NG_VALID_CLASS);
+ element.classes.add(NG_INVALID_CLASS);
+ }
+
+}
« no previous file with comments | « third_party/pkg/angular/lib/directive/module.dart ('k') | third_party/pkg/angular/lib/directive/ng_events.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698