Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Commit

Permalink
feat(forms): use the ng-form attribute as the name of the inner form
Browse files Browse the repository at this point in the history
Closes #681
  • Loading branch information
matsko authored and mhevery committed Mar 6, 2014
1 parent 4c9b804 commit 8b989b6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/directive/ng_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ class NgForm extends NgControl {
}
}

//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;
}
}

get controls => _controlByName;

NgControl operator[](name) {
Expand All @@ -68,6 +77,7 @@ class NgForm extends NgControl {

class NgNullForm extends NgNullControl implements NgForm {
NgNullForm() {}
operator []=(String key, value) {}
operator[](name) {}

get controls => null;
Expand Down

0 comments on commit 8b989b6

Please sign in to comment.