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

[x ] bug report => search github for a similar issue or PR before submitting

Current behavior

I am currently working on a project based on https://github.com/AngularClass/angular2-webpack-starter. Everything is working fin in dev deployement (npm run server:dev ).

But after a npm run build:prod and npm run server:prod when I try to access to my app I have this js error :

http://pasteboard.co/9llDiJNGv.png

function _split(t) {
return t.match(c)
}

Currently after pretty print in chrome the error seem to be an error in my component routing somewhere. I will investigate more but I post this issue because is not normal that my code is working in dev but not in prod. If I find why I will post the answers here.

Currently my routing look like:

app.routes.ts:

export const ROUTES: Routes = [
{ path: '', loadChildren: './app/<componentName>/<componentName>.module#<componentName>Module' },
{ path: '**', component: NoContent },
];

.routing.ts:

const routes: Routes = [
{ path: "",
component: <componentName>Component,
children: [
{ path:"", component: <componentName>ListComponent},
{ path:"<componentName2>", component: <componentName2>},
{ path:"<componentName3>", component: <componentName3>},
{ path:"<componentName4>", component: <componentName4>},
{ path:"<componentName5>", component: <componentName5>},
]
}
];

Expected behavior

No javascript error and my app working like in dev mode

Reproduction of the problem

Can't see how.

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

Having a working app

Please tell us about your environment:

All operating system

IDE -> webstorm 2016.2.3

package manager -> npm

HTTP server -> node (windows) and nginx(linux)

Angular version: 2.0.0

Browser: [all ]

Language: [TypeScript 2.0.3]

Node (for AoT issues): node --version = v6.6.0 and v6.7.0

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

Accessing a local components instance inside of a dynamically added component doesn't work. i.e. I load a component inside of an ngSwitch and then I want to reference the components instance to a local variable. However this doesn't seem to work.

Expected behavior

You should be able to access any local components instance.

Minimal reproduction of the problem with instructions

http://plnkr.co/edit/jKpVgdErsJc7VwVexIvq?p=preview

Click the "Access foo" button - you'll see the inner instance of the foo component logged, but outside of the ngSwitch it cannot be accessed.

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

I'm guessing this is caused by the way *ngSwitchCase desugar's to a template tag, however it's not very obvious that this is the case by looking at the html structure. I'd expect to be able to create a local variable and reference it anywhere else in the components template.

Please tell us about your environment:

N/A

Angular version: 2.0.X

2.4.4

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 ]

All

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

Typescript

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

N/A