Issue 1:
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

After upgrading working app from 4.0.0 to 4.0.1 or 4.1.0-beta.0, when navigating to a new component (lazy loaded but dont know if that matters yet) CanDeactivate guard is called with null component and providers are not being provided to new component (sometimes I get only one of these errors, sometimes I get both as shown below, and occasionally I get other errors not captured here)

ERROR Error: Uncaught (in promise): Error: No provider for MyService!
Error
at injectionError (core.es5.js:1231) [angular]
at noProviderError (core.es5.js:1269) [angular]
at ReflectiveInjector_._throwOrNull (core.es5.js:2770) [angular]
at ReflectiveInjector_._getByKeyDefault (core.es5.js:2809) [angular]
at ReflectiveInjector_._getByKey (core.es5.js:2741) [angular]
at ReflectiveInjector_.get (core.es5.js:2610) [angular]
at AppModuleInjector.NgModuleInjector.get (core.es5.js:3557) [angular]
at MySearchModuleInjector.NgModuleInjector.get (core.es5.js:3557) [angular]
at resolveDep (core.es5.js:10930) [angular]
at createClass (core.es5.js:10799) [angular]
at createDirectiveInstance (core.es5.js:10627) [angular]
at createViewNodes (core.es5.js:11977) [angular]
at createRootView (core.es5.js:11882) [angular]
at callWithDebugContext (core.es5.js:13013) [angular]
at injectionError (core.es5.js:1231) [angular]
at noProviderError (core.es5.js:1269) [angular]
at ReflectiveInjector_._throwOrNull (core.es5.js:2770) [angular]
at ReflectiveInjector_._getByKeyDefault (core.es5.js:2809) [angular]
at ReflectiveInjector_._getByKey (core.es5.js:2741) [angular]
at ReflectiveInjector_.get (core.es5.js:2610) [angular]
at AppModuleInjector.NgModuleInjector.get (core.es5.js:3557) [angular]
at MySearchModuleInjector.NgModuleInjector.get (core.es5.js:3557) [angular]
at resolveDep (core.es5.js:10930) [angular]
at createClass (core.es5.js:10799) [angular]
at createDirectiveInstance (core.es5.js:10627) [angular]
at createViewNodes (core.es5.js:11977) [angular]
at createRootView (core.es5.js:11882) [angular]
at callWithDebugContext (core.es5.js:13013) [angular]
at resolvePromise (zone.js:712) [angular]
at resolvePromise (zone.js:683) [angular]
at :4200/polyfills.bundle.js:2764:17 [angular]
at Object.onInvokeTask (core.es5.js:4116) [angular]
at ZoneDelegate.webpackJsonp.626.ZoneDelegate.invokeTask (zone.js:397) [angular]
at Zone.webpackJsonp.626.Zone.runTask (zone.js:165) [<root> => angular]
at drainMicroTaskQueue (zone.js:593) [<root>]
at HTMLAnchorElement.ZoneTask.invoke (zone.js:464) [<root>]
defaultErrorLogger @ core.es5.js:1084
ErrorHandler.handleError @ core.es5.js:1144
next @ core.es5.js:4754
schedulerFn @ core.es5.js:3828
SafeSubscriber.__tryOrUnsub @ Subscriber.js:234
SafeSubscriber.next @ Subscriber.js:183
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ core.es5.js:3814
NgZone.triggerError @ core.es5.js:4185
onHandleError @ core.es5.js:4146
webpackJsonp.626.ZoneDelegate.handleError @ zone.js:369
webpackJsonp.626.Zone.runGuarded @ zone.js:141
_loop_1 @ zone.js:604
drainMicroTaskQueue @ zone.js:613
ZoneTask.invoke @ zone.js:464
core.es5.js:1084

ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'canDeactivate' of null
TypeError: Cannot read property 'canDeactivate' of null
at CanDeactivateGuard.webpackJsonp.224.CanDeactivateGuard.canDeactivate (CanDeactivate.ts:9)
at MergeMapSubscriber.project (router.es5.js:4394)
at MergeMapSubscriber._tryNext (mergeMap.js:120)
at MergeMapSubscriber._next (mergeMap.js:110)
at MergeMapSubscriber.Subscriber.next (Subscriber.js:89)
at ArrayObservable._subscribe (ArrayObservable.js:114)
at ArrayObservable.Observable._trySubscribe (Observable.js:57)
at ArrayObservable.Observable.subscribe (Observable.js:45)
at MergeMapOperator.call (mergeMap.js:85)
at Observable.subscribe (Observable.js:42)
at EveryOperator.call (every.js:33)
at Observable.subscribe (Observable.js:42)
at Object.subscribeToResult (subscribeToResult.js:22)
at MergeMapSubscriber._innerSub (mergeMap.js:130)
at MergeMapSubscriber._tryNext (mergeMap.js:127)
at CanDeactivateGuard.webpackJsonp.224.CanDeactivateGuard.canDeactivate (CanDeactivate.ts:9)
at MergeMapSubscriber.project (router.es5.js:4394)
at MergeMapSubscriber._tryNext (mergeMap.js:120)
at MergeMapSubscriber._next (mergeMap.js:110)
at MergeMapSubscriber.Subscriber.next (Subscriber.js:89)
at ArrayObservable._subscribe (ArrayObservable.js:114)
at ArrayObservable.Observable._trySubscribe (Observable.js:57)
at ArrayObservable.Observable.subscribe (Observable.js:45)
at MergeMapOperator.call (mergeMap.js:85)
at Observable.subscribe (Observable.js:42)
at EveryOperator.call (every.js:33)
at Observable.subscribe (Observable.js:42)
at Object.subscribeToResult (subscribeToResult.js:22)
at MergeMapSubscriber._innerSub (mergeMap.js:130)
at MergeMapSubscriber._tryNext (mergeMap.js:127)
at resolvePromise (zone.js:712) [angular]
at resolvePromise (zone.js:683) [angular]
at :4200/polyfills.bundle.js:2764:17 [angular]
at Object.onInvokeTask (core.es5.js:4116) [angular]
at ZoneDelegate.webpackJsonp.626.ZoneDelegate.invokeTask (zone.js:397) [angular]
at Zone.webpackJsonp.626.Zone.runTask (zone.js:165) [<root> => angular]
at drainMicroTaskQueue (zone.js:593) [<root>]
at HTMLAnchorElement.ZoneTask.invoke (zone.js:464) [<root>]

Expected behavior

CanDeactivate guard should not be called with null component and providers should be provided

Minimal reproduction of the problem with instructions

Will try to create plnkr when have time.

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

Breaking change. Causes crash in existing code that works as expected in 4.0.0

Please tell us about your environment:

@angular/cli: 1.0.0

node: 7.7.1

os: win32 x64

@angular/common: 4.1.0-beta.0

@angular/compiler: 4.1.0-beta.0

@angular/core: 4.1.0-beta.0

@angular/forms: 4.1.0-beta.0

@angular/http: 4.1.0-beta.0

@angular/platform-browser: 4.1.0-beta.0

@angular/platform-browser-dynamic: 4.1.0-beta.0

@angular/router: 4.1.0-beta.0

@angular/cli: 1.0.0

@angular/compiler-cli: 4.1.0-beta.0

Angular version: 2.0.X

Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

Only tried in Chrome

Language: [all | TypeScript X.X | ES6/7 | ES5]

Node (for AoT issues): node --version =

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

[x] bug report
[ ] feature request
[ ] support request

Current behavior

If an app uses HashLocationStrategy and the URL hash is changed manually, the subscribe observable of the Location service will fire two events for the same change. This will also occur if the browser back/forward buttons are used or when clicking a traditional anchor with href="#foo".

Expected behavior

The Location service should emit exactly one event for each discrete change in location.

Minimal reproduction of the problem with instructions

See this plunkr. Click the One and Two anchors to see the events logged. You may also want to open the plunkr in a separate window and change the hash manually.

As you can see, two events are logged for each change.

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

Although Location by itself may cause trouble, the main issue is that each location change event is scheduling a new router navigation. Appearently, the router cannot remember that it is already in the process of changing to an URL and issues a second navigation to the same URL.

The end result is that there will be two router navigations running in parallel. In my experience, it at least causes double invocation of guards/resolvers.

Angular version: 2.0.2 up to 2.1.0-rc.0

Browser: Chrome 53, Firefox 49

Language: all