Issue 1:
Steps to reproduce and a minimal demo of the problem

You can see the issue in the official routing demo: https://angular.io/resources/live-examples/toh-5/ts/plnkr.html.

What steps should we try in your demo to see the problem?

Open the demo in Internet Explorer 11.

Click a route link to navigate to it. This works fine and the new route content displays correctly.

Click the browser's back button to go back to the previous route.

Current behavior

In Internet Explorer 11, most of the component content is not rendered when using the browser back or forward buttons to navigate to it.

Expected/desired behavior

Route content should be displayed regardless of whether navigation occurred via a link or back/forward buttons.

Other information

Chrome and Firefox work fine, so this must be caused by a difference in Internet Explorer.

Issue 2:
I'm submitting a ... (check one with "x")

[X ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Currently, I have a deactivation guard on a route which will return false or true depending on a condition. To get to this guarded route, the user must pass though 3 navigation step. Now, once on the guarded route, when using location.back(), the guard is called. If it returns true, the previous route is loaded. If the guard returns false, the navigation is cancelled. But if we redo a Location.back() after a failed navigation, the previous route that will be loaded will be 2 steps in the history instead of 1 (user perception).

Workflow

Main -- navigate to --> Route 1
Route 1 -- navigate to --> Route 2
Route 2 -- navigate to --> Route 3
Route 3 -- location.back() --> guard returns true --> Route 2
Route 2 -- navigate to --> Route 3
Route 3 -- location.back() --> guard returns false --> Route 3
Route 3 -- location.back() --> guard returns true --> Route 1 (should be Route 2)

Expected behavior

An expected behavior for a user would be that navigating back brings back to the previous routed page.

Workflow

Main -- navigate to --> Route 1
Route 1 -- navigate to --> Route 2
Route 2 -- navigate to --> Route 3
Route 3 -- location.back() --> guard returns true --> Route 2
Route 2 -- navigate to --> Route 3
Route 3 -- location.back() --> guard returns false --> Route 3
Route 3 -- location.back() --> guard returns true --> Route 2 (expected)

Minimal reproduction of the problem with instructions

Plnkr

Click button Nav to route1

Click button Nav to route2

Click button Nav to route3

Click button Block Nav Back

Click button Nav back

BOGUE: The location.back() routed on Route1 instead of Route2

Personnal investigation

After some investigation, I saw that in routerState$.then (router.ts line 752) this logic used when navigationIsSuccessful == false is pretty simply but it is the actual cause of this bug. Basically, when a deactivation guard is hit, the location of the browser is already changed to the previous route. Which means that when the guard returns false, the routerState$ runs his logic and calls resetUrlToCurrentUrlTree(). At this point we can see that we replace the state of the current location. But by doing this, we loose that route in the history which means that in my plunker, if we click the block nav back 3 times and then click the nav back we will actually kill the application.

What is the motivation / use case for changing the behavior?

This is for me a pretty big bug since a guard that returns false breaks alters the current routing history. In the case of our application this breaks the workflow and brings wrong business scopes to a user.

Please tell us about your environment:

Windows 10, NPM, Nodejs, Visual Studio 2015 (using nodejs for typescript compilation)

Angular version: 2.3.3

Browser: [ all ]

Language: [TypeScript 2.0.10 | ES5]