This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
ngHref adds two history records in legacy browsers #8998
Closed
Description
Clicking on a link with ngHref directive in a legacy browser (IE8-9) will adds two records into browser history. There are need two clicks on back button to get back to previous page then.
Here is a sample application that will reproduce this behavior (needs to be run IE8-9):
(sorry I didn't manage to create a working plunkr example)
"use strict";
var App = angular.module("App", ["ngRoute"]);
App.config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
$routeProvider.when("/", {
controller: function ($scope) {
$scope.url = "/second";
},
template: "<a ng-href=\"{{url}}\">Click me!</a>"
});
$routeProvider.when("/second", {
template: "<h1>Now click on browser back button.</h1>"
});
$routeProvider.otherwise({redirectTo: "/"});
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix("!");
}]);
I'm running AngularJS v1.2.15.
Can you please confirm this bahaviour?