Get textarea value using ng-model and $scope?


What is the proper way to get the value of a textarea using ng-model and $scope? I cant seem to get it working…

I got this and the $var is undefined…:

$scope.$on('$ionicView.leave', function(){
             $var = $scope.testing;

and I got this:

<textarea ng-model="testing"></textarea>


do you declare $var at the beginning of your scope?
or have you a form around your textarea?


What do you mean by declaring it at the beginning of scope?
And I dont have a form wrapping the textarea…


could you build a codepen or post the full template and controller code?