| 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);
|
| + }
|
| +
|
| +}
|
|
|