-2
如何更新用戶在文本區域中輸入的值的角度模型。 我必須動態地創建文本區域。如何更新角度JS的模型時,用戶按下OK鍵來給出值如何更新在textarea中輸入的動態創建的值的ng-model
function relation(event){
var display_area=document.getElementById("cart");
// '<textarea maxlength="50" cols="18" rows="4" id="getRelation" style="border: solid 2px; "></textarea>'
var relation_wrapper=document.createElement("div");
relation_wrapper.style.border="solid,3px";
relation_wrapper.style.borderColor="black";
relation_wrapper.style.width="100px";
relation_wrapper.style.height="500px";
relation_wrapper.style.backgroundColor="red";
var lineBreak=document.createElement("br");
var get_relation_button=document.createElement("button");
var button_text=document.createTextNode("OK");
relation_wrapper.appendChild(document.createElement("TEXTAREA"));
relation_wrapper.appendChild(lineBreak);
get_relation_button.appendChild(button_text);
relation_wrapper.appendChild(get_relation_button);
display_area.appendChild(relation_wrapper); }
後,這將創建一個文本區域和一個按鈕 現在我想以更新的角度模型時,用戶按下按鈕的價值。 任何想法我怎麼能做到這一點
是什麼型號?絕對沒有任何問題的角碼,我們不知道你是如何實現代碼 – charlietfl 2015-04-05 15:10:16