Get textarea value using ng-model and $scope?


#1

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>

#2

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


#3

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


#4

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