GitHub PullRequestReviewCommentEvent at 2014-03-15 03:20:32
Repository: angular.dart
Actor: mhevery
Payload: {"comment":{"url":"https://api.github.com/repos/angular/angular.dart/pulls/comments/10633215","id":10633215,"diff_hunk":"@@ -78,53 +72,18 @@ abstract class NgControl implements NgAttachAware, NgDetachAware {\n \n   get element => _element;\n \n-  bool get pristine => !_dirty;\n-  set pristine(value) {\n-    //only mark as pristine if all the child controls are pristine\n-    if (_controls.any((control) => control.dirty)) return;\n-\n-    _dirty = false;\n-    element..addClass(NG_PRISTINE_CLASS)..removeClass(NG_DIRTY_CLASS);\n-    _parentControl.pristine = true;\n-  }\n-\n-  bool get dirty => _dirty;\n-  set dirty(value) {\n-    _dirty = true;\n-    element..addClass(NG_DIRTY_CLASS)..removeClass(NG_PRISTINE_CLASS);\n-\n-    //as soon as one of the controls/models is modified\n-    //then all of the parent controls are dirty as well\n-    _parentControl.dirty = true;\n-  }\n-\n-  bool get valid => _valid;\n-  set valid(value) {\n-    _valid = true;\n-    element..addClass(NG_VALID_CLASS)..removeClass(NG_INVALID_CLASS);\n-  }\n+  get valid              => !invalid;\n+  get invalid            => errorStates.isNotEmpty;\n \n-  bool get invalid => !_valid;\n-  set invalid(value) {\n-    _valid = false;\n-    element..addClass(NG_INVALID_CLASS)..removeClass(NG_VALID_CLASS);\n-  }\n-\n-  bool get touched => _touched;\n-  set touched(value) {\n-    _touched = true;\n-    element..addClass(NG_TOUCHED_CLASS)..removeClass(NG_UNTOUCHED_CLASS);\n+  get pristine           => !dirty;\n+  set pristine(bool v)   => dirty = !v;\n+  get dirty              => infoStates.containsKey(NG_DIRTY);\n+  set dirty(bool v) {}\n \n-    //as soon as one of the controls/models is touched\n-    //then all of the parent controls are touched as well\n-    _parentControl.touched = true;\n-  }\n-\n-  bool get untouched => !_touched;\n-  set untouched(value) {\n-    _touched = false;\n-    element..addClass(NG_UNTOUCHED_CLASS)..removeClass(NG_TOUCHED_CLASS);\n-  }\n+  get untouched          => !touched;\n+  set untouched(bool v)  => touched = !v;\n+  get touched            => infoStates.containsKey(NG_TOUCHED);\n+  set touched(bool v) {}","path":"lib/directive/ng_control.dart","position":144,"original_position":144,"commit_id":"9588b98a50aa2857b5a8ba5adaf33f005b8fd933","original_commit_id":"9588b98a50aa2857b5a8ba5adaf33f005b8fd933","user":{"login":"mhevery","id":111951,"avatar_url":"https://gravatar.com/avatar/8d67eedc1442e8392a7add197abacd66?d=https%3A%2F%2Fidenticons.github.com%2F65b8376e9cd93c4ab07aedbf3ef4d89d.png&r=x","gravatar_id":"8d67eedc1442e8392a7add197abacd66","url":"https://api.github.com/users/mhevery","html_url":"https://github.com/mhevery","followers_url":"https://api.github.com/users/mhevery/followers","following_url":"https://api.github.com/users/mhevery/following{/other_user}","gists_url":"https://api.github.com/users/mhevery/gists{/gist_id}","starred_url":"https://api.github.com/users/mhevery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhevery/subscriptions","organizations_url":"https://api.github.com/users/mhevery/orgs","repos_url":"https://api.github.com/users/mhevery/repos","events_url":"https://api.github.com/users/mhevery/events{/privacy}","received_events_url":"https://api.github.com/users/mhevery/received_events","type":"User","site_admin":false},"body":"I think you want to remove this setter?","created_at":"2014-03-15T03:20:32Z","updated_at":"2014-03-15T03:20:32Z","html_url":"https://github.com/angular/angular.dart/pull/736#discussion_r10633215","pull_request_url":"https://api.github.com/repos/angular/angular.dart/pulls/736","_links":{"self":{"href":"https://api.github.com/repos/angular/angular.dart/pulls/comments/10633215"},"html":{"href":"https://github.com/angular/angular.dart/pull/736#discussion_r10633215"},"pull_request":{"href":"https://api.github.com/repos/angular/angular.dart/pulls/736"}}}}