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!