How do I pass the html element through my function when using AngularJS. This would work if you don't use AngularJS, but I think AngularJS confuses the "this" keyword with some other parent. How would I get this code to work?
angular.module('myApp', []).controller('myCtrl', function($scope) {
$scope.MyFunction = function(element) {
alert(element.value);
element.focus();
}
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myCtrl">
<input ng-click="MyFunction(this)" value="Hello">
</div>