2015-10-19 107 views
0

總額在數量上我有我的形式兩個領域如波紋管單詞轉換

Total amount: <input type="text" value="1230"></input> 
<br> 
<textarea>amount in words goes here..</textarea> 

現在,我需要爲1230,以顯示我的第一個輸入字段的值量的textarea。

謝謝

+2

請熟悉angularjs的基本概念。 –

+0

刪除這個問題,它對你很好。 – katmanco

回答

0

Angular在這方面沒有任何作用。它必須使用的簡單邏輯。此問題的回答爲here

UPDATEThis是我發現您的問題的另一種解決方案。

+0

謝謝Ayush ... –

0

爲了讓你開始: 使用NG-模型綁定到數據和NG-變化模型,以對您輸入的任何變化做出反應:

Total amount: <input type="text" ng-model="data.text" ng-change="countWords()" value="1230"></input> 
在你的控制器

$scope.data = {text:"", count:0}; 
$scope.countWords = function(){ 
    $scope.data.count = [count the words of $scope.data.text...] 
}; 

然後在您的視圖中顯示該值:

<textarea>{{data.count}}</textarea>