Pat
2016-03-21 22:41:03 UTC
I have defined the following element in angular JS
<input type="text" ng-model="username">
I can access it using $scope.username in controller etc. So far so good.
How can I access it from using DOM model?
var elem = document.getElementById('username'); //does not work
elem.value = "Some value";
console.dir(elem);
var elem = document.getElementById('ng-model="username"'); //does not work
elem.value = "Some value";
console.dir(elem);
This may not be the recommended, but wish to know.
Thanks!
<input type="text" ng-model="username">
I can access it using $scope.username in controller etc. So far so good.
How can I access it from using DOM model?
var elem = document.getElementById('username'); //does not work
elem.value = "Some value";
console.dir(elem);
var elem = document.getElementById('ng-model="username"'); //does not work
elem.value = "Some value";
console.dir(elem);
This may not be the recommended, but wish to know.
Thanks!
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.