Skip to content

Instantly share code, notes, and snippets.

@lanterndev
Last active January 3, 2016 07:39
Show Gist options
  • Save lanterndev/8430668 to your computer and use it in GitHub Desktop.
Save lanterndev/8430668 to your computer and use it in GitHub Desktop.
AngularJS Issue 4608 (with target="_self")
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>AngularJS Plunker</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular.min.js"></script>
<script>
angular.module('broken', [])
.controller('MainCtrl', function ($scope, $location) { });
</script>
</head>
<body>
<div ng-app="broken">
<h1>AngularJS with anchor link - broken by injecting $location</h1>
<div ng-controller="MainCtrl">
<a href="#anchor" target="_self">broken link to anchor</a>
<div style="margin-top: 800px">
<a name="anchor">anchor</a>
</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment