答案 0 :(得分:0)
<textarea class="form-control" name="address" ng-model="textContent" placeholder="Type your Address" rows="5"></textarea>
在范围
的帮助下进行控制器访问 function ctrl($scope){
console.log($scope.textContent);
}
答案 1 :(得分:0)
您可以在ng-model
这样使用textarea
,
<textarea class="form-control" ng-model="details" name="address" placeholder="Type your Address" rows="5"></textarea>
然后在控制器中你可以像
那样访问它angular.module('myApp', []).controller('myCtrl', function($scope) {
console.dir($scope.details);
});
从官方的angularjs文档中查看ng-model。 你知道吗,真该死!