JSFiddle - React, Tailwind, and code Playground

HTML

<script src="http://code.angularjs.org/1.0.1/angular-1.0.1.min.js"></script>
<div ng-controller="foo">
<a href="#" ng-click="bar($event)">weird bug on IE9</a>
<input type="text" ng-model="val">
</div>

JavaScript

var app = angular.module( 'fiddle', [] )

/* Try with the $location dependency, then try without.
    WITH the dependency, the default doesn't seem to be prevented,
    and after the alert, the input quickly flickers with the 'test'
    value then goes back to initial, because the page is reloaded.
    
    WITHOUT the dependency, it works as expected, the value stays with 'test'.
    
    This fiddle shows a WORKAROUND using the $event argument and calling preventDefault() manually.
*/
function foo ( $scope, $location ) {
    $scope.val = 'initial'
    $scope.bar = function ($event) {
      alert('test')
      this.val = 'test'
      $event.preventDefault()
    };
}