0
AngularJS的特性 'myInputName' 是給我下面的錯誤:AngularJS:無法讀取未定義
其中titleInput
是我的文本框的name屬性:
@Html.TextBox("titleInput", null, new { @placeholder = @T("Message title"), @class = "form-control", ng_model = "feed.feedData().title", ng_required = "true" })
FeedValidationService
方法,讓我那個錯誤是:
public titleInputValidation(messageForm: any, isTitleInputValid: boolean): boolean {
if (messageForm.titleInput.$valid) {
isTitleInputValid = true;
}
else {
isTitleInputValid = false;
}
return isTitleInputValid;
}
這是工作,一切都可以,除了瀏覽器中的這個錯誤。我怎樣才能擺脫這一點?
是啊! :)我忘了檢查messageForm是否存在。謝謝 :) – Marox