I\'m converting a project to use angular cli and everything is working (once it\'s build) but i\'ve got a weird behaviour during build.
with ng serve
I
I also ran into a similar issue with the Angular CLI v1.6.
In my case I was not using .concat()
or any other kind of dynamic manipulation of the router definitions.
Rather I had a function in a data property of a route which was an anonymous arrow function. Changing this to a named exported function solved the issue for me.
Before:
{
path: ':id',
component: ProductDetailComponent,
data: {
breadcrumb: (data: any, params: any) => {
let id = params['id'];
return id === 'create' ? 'New Product' : data.product.ShortDescription;
}
}
}
After:
{
path: ':id',
component: ProductDetailComponent,
data: { breadcrumb: getBreadcrumb }
}
export function getBreadcrumb(data: any, params: any): string {
let id = params['id'];
return id === 'create' ? 'New Product' : data.product.ShortDescription;
}