Reputation: 1504
HTML:
<td hidden ng-bind="msg.location" id="msg_location"></td>
After page loading it seems like:
<td hidden ng-bind="msg.location" id="msg_location">/2/</td>
i want to get text of td in angularjs. I tried following:
angular.element('#msg_location').html()
angular.element('#msg_location').text()
angular.element('#msg_location').innerHTML
but all of above soltions returns empty string. Can anyone help me?
thanks in advance.
Upvotes: 0
Views: 312
Reputation: 6280
BECAFULL YOU USE ANGULARJS AND NOT JQUERY. So you just need to set a ng-model like bellow: html
<td hidden ng-model='msg.location' ></td>
JS
console.log('DATA IS ',$scope.msg.location);
Upvotes: 1