I cannot find any document that explains how to manipulate forms in Angular Dart.
I have the following code in my_component.html:
<form name="form" ng-submit="comp.save()">
<input type="text" required ng-model="comp.user.firstname">
<input type="text" required ng-model="comp.user.lastname">
<button ng-disabled="form.invalid">Save</button>
</form>
And the next one is in my_component.dart:
@NgComponent(
selector : 'my-component',
templateUrl : 'my_component.html',
publishAs : 'comp'
)
class MyComponent {
@NgTwoWay('user')
User user;
@NgTwoWay('form')
NgForm form;
MyComponent() {};
void save() {
print(form);
}
}
Validation works well, but when the button is pressed, the operator print(form)always prints null.
Any idea?
thank
source
share