0
我遇到問題。當我使用靜態模板上渲染頁面輸入AngularJs的動態ng模型
<form name="AddArticle" ng-submit="addArticle()" class="form add-article">
<input type="text" value="first" init-from-form ng-model="article.text[0]" />
<input type="text" value="second" init-from-form ng-model="article.text[1]" />
</form>
當我做提交表單,我得到的數據:
{text : {0: "first", 1: "second"}}
但我有動力矩。通過點擊我添加動態input
$(".button").click(function(){
$('.form').append('<input ng-model="article.info" init-from-form type="text" />');
})
好的。所有附加,但通過提交我仍然沒有動態輸入數據。
請告訴我,如何獲取所有字段?
爲什麼不只是你已經附加在文檔中但它與'隱藏的形式NG - 如果? – Pytth
,因爲這個信息我通過自動完成,並通過點擊我添加輸入的值,我必須在'ng模型中使用,我不能立即添加這個 – ennet