手動提交表單我有這個角形式在angularJS
<ion-nav-buttons side="right">
<a class="button button-icon icon ion-android-done" href="#search/search-form" ng-click="submitNewPublishMessage(msgForm.$valid, msgForm)"></a>
</ion-nav-buttons>
<ion-content>
<form name="msgForm" class="css-form" novalidate>
<input type="text" name="title" ng-model="msgForm.title" ng-minlength="10" ng-maxlength="150" required>
...
...
我想手動提交form
當我通過調用submitNewPublishMessage()
內部控制器點擊a
都msgForm.$valid, msgForm
來了不確定的。
$scope.submitNewPublishMessage = function(isValid, form)
{
alert(isValid);
alert(JSON.stringify(form));
}
裏面'submitNewPublishMessage'我怎麼會得到表單字段值在這裏我得到錯誤像'{「$$ parentForm」:{},「$ error」:{「minlength」:[{「$ viewValue」:「 hdjdjfgg「,」$$ rawModelValue「:」hdjdjfgg「,」$ validators「:{},」$ asyncValidator「 – manish
表單字段值位於'$ scope.model'中。 –