У меня есть следующее текстовое поле:
<textarea class="form-control" [(ngModel)]="content" name="content" required>
</textarea>
и следующую кнопку отправки:
<button type="submit" class="btn btn-default" [disabled]="content.valid">New comment</button>
Как я увидел в руководстве angular 2 (https://angular.io/docs/ts/latest/guide/forms.html), я могу использовать x.valid
, чтобы проверить, не является ли он пустым.
Почему я получаю ошибку TypeError: Cannot read property 'valid' of undefined
?