Issue 1:
[X ] bug report
[ ] feature request
[ ] support request

Current behavior

I am working on my Angular2 component where I have a component that displays a login status that has no dependency on which routing is picked. I have also a component that displays the proper page with . Both are defined in the same @NgModule annotation and both need to be bootstrapped as they are part of a static html page.

@NgModule({
declarations: [DisplayPageComponent, LoginStatusComponent],
imports: [RouterModule.forRoot(routes)],
bootstrap: [DisplayPageComponent, LoginStatusComponent]
})

When I press the next button to go a different page, I go to the other page for a split second and then go back to the previous step.

If I subscribe to router.events I see I navigate to the page and then the page is disabled again as the id has changed on this line:

this.routerEvents.next(new NavigationCancel(id, this.serializeUrl(url), "Navigation ID " + id + " is not equal to the current navigation id " + this.navigationId));

It seems the login status component also listens to the routing and disables the page and you receive no feedback if you do not subscribe to router events.

Expected behavior

I expect the routing navigation is only handled once and not the number of components that are bootstrapped.

Minimal reproduction of the problem with instructions

I can create a plunkr if required

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

Even if the way I use modules is incorrect I would expect to get at least some feedback why the navigation was blocked/failed

Angular version: 2.0.1

Browser: all

Language: all

Issue 2:
*I'm submitting a ... *

[ ] bug report

[ X] feature request

What is the current behavior?

I'm using Http in an app and accidentally forgot to include http.dev.js in my index.html and received the following error as the app tried to load:

angular2-polyfills.js:322 Error: SyntaxError: Unexpected number(…)

ZoneDelegate.invoke @ angular2-polyfills.js:322

Zone.run @ angular2-polyfills.js:218

(anonymous function) @ angular2-polyfills.js:567

ZoneDelegate.invokeTask @ angular2-polyfills.js:355

Zone.runTask @ angular2-polyfills.js:254

drainMicroTaskQueue @ angular2-polyfills.js:473

ZoneTask.invoke @ angular2-polyfills.js:425

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via

Although this isn't a bug, here's how to duplicate the error above:

Use an Http import in an Angular 2 service:

import { Http, Response } from 'angular2/http';

Leave out the http.dev.js script from index.html (I should've included something like the script below but forgot it). Leaving out any of the key Angular scripts seems to cause the error if imports need objects that are in the missing script.

<!-- Should have included this script -->
<script src="node_modules/angular2/bundles/http.dev.js"></script>

Since Http is missing you'll get the angular2-polyfills.js:322 Error: SyntaxError: Unexpected number(…) error. The obvious answer is "Don't forget the script!" but I suspect I won't be the first or the last to do that and having a more detailed error would be helpful.

What is the expected behavior?

Show a more detailed error about the actual script, object (or import) that is missing or that led to the problem. Getting "Unexpected number" is tough to debug.

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

Would save devs a lot of time figuring out simple mistakes like this if an import won't work due to a missing script.

Please tell us about your environment:

Angular version: 2.0.0-beta.11

Browser: [Chrome 49 ]

Language: [TypeScript 1.8.7]