I am trying to combine a material-stepper
with a form in AngularDart. The continue button from the material-stepper should be disabled as long as some required inputs are missing from the form. When the form is completed, the continue button should trigger a submit on the form.
However, as the step is a template, it creates its own scope and the reference to form
cannot be used outside this scope. Therefore, the following code will not compile with error The getter 'form' isn't defined for the class...
.
<material-stepper>
<template step
name="Personal data"
(continue)="form.submit()"
[canContinue]="form.valid"
>
<form #form="ngForm">
<material-input required
label="Name"
ngControl="name"
></material-input>
</form>
form complete: {{form.valid}}
</template>
</material-stepper>
Is there another way to access the form or another solution to accomplish the same behavior?