Skip to main content
added 8 characters in body
Source Link
Leo
  • 13.9k
  • 5
  • 47
  • 64

This is my code

HTML:

<div class="someClass"> <label>Enter Text Here:</label> <textarea id="content-editable" ng-model="myTextArea" ng-keyup="callme($event)"> </textarea> </div>

<div class="someClass">
  <label>Enter Text Here:</label>
  <textarea id="content-editable" ng-model="myTextArea" ng-keyup="callme($event)">
  </textarea>
</div>

JS  : var text = $scope.myTextArea.text

var text = $scope.myTextArea.text

I am getting an exception in JS that "cannot find property text of undefined".

I am not sure if text property is needed to get the text from textarea but I am getting undefined in debugger for $scope.myTextArea

Whats wrong?

This is my code

HTML:

<div class="someClass"> <label>Enter Text Here:</label> <textarea id="content-editable" ng-model="myTextArea" ng-keyup="callme($event)"> </textarea> </div>

JS  : var text = $scope.myTextArea.text

I am getting an exception in JS that "cannot find property text of undefined".

I am not sure if text property is needed to get the text from textarea but I am getting undefined in debugger for $scope.myTextArea

Whats wrong?

This is my code

HTML:

<div class="someClass">
  <label>Enter Text Here:</label>
  <textarea id="content-editable" ng-model="myTextArea" ng-keyup="callme($event)">
  </textarea>
</div>

JS:

var text = $scope.myTextArea.text

I am getting an exception in JS that "cannot find property text of undefined".

I am not sure if text property is needed to get the text from textarea but I am getting undefined in debugger for $scope.myTextArea

Whats wrong?

Source Link
user3519456
user3519456

Angular ng-model is undefined in JS

This is my code

HTML:

<div class="someClass"> <label>Enter Text Here:</label> <textarea id="content-editable" ng-model="myTextArea" ng-keyup="callme($event)"> </textarea> </div>

JS : var text = $scope.myTextArea.text

I am getting an exception in JS that "cannot find property text of undefined".

I am not sure if text property is needed to get the text from textarea but I am getting undefined in debugger for $scope.myTextArea

Whats wrong?