AngularJS with velocity

AngularJS with velocity

本文关键字:velocity with AngularJS      更新时间:2023-09-26

如何使用id获取html元素的值,而不使用ng-model

我尝试以速度获取数据到我的页面,我将此值设置为textarea,我可以让用户修改此元素的内容,为此我得到了我的数据。

问题是当用户修改元素的内容时,如何使用angularjs进行修改

我试着这样做

<textarea class="form-control" id="description" rows="2" data="" ng-model="demand.description" placeholder="">
   $demand.description
</textarea>
在屏幕上我没有看到textarea
的值

我已经用这种方式解决了问题,它不是很好,但我现在有什么

 $scope.validateModification = function(){
    $scope.demand.description = $('#description').val();
    alert ($scope.demand.description);
    //after i sent the $scope.Demand to server
 }

 <textarea name="description" id="description">$demand.description</textarea>