मैं निम्नलिखित पाठ क्षेत्र:लेखन त्रुटि: संपत्ति के 'वैध' नहीं पढ़ सकते हैं अपरिभाषित
<textarea class="form-control" [(ngModel)]="content" name="content" required>
</textarea>
और निम्न सबमिट बटन:
<button type="submit" class="btn btn-default" [disabled]="content.valid">New comment</button>
मैं कोणीय 2 प्रपत्र गाइड में देखा (https://angular.io/docs/ts/latest/guide/forms.html) यह जांचने के लिए कि क्या यह खाली नहीं है, मैं x.valid
का उपयोग कर सकता हूं।
मुझे TypeError: Cannot read property 'valid' of undefined
त्रुटि क्यों मिलती है?
मैं लगता है कि आप इस याद किया: '# नाम = "ngModel"'। आपके मामले में: # सामग्री = "ngModel" – michael
असल में मुझे एक ही त्रुटि मिलती है – TheUnreal