-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loadChildren: ()=> './myroute/blah/blah' is not assignable to type Route #13
Comments
+1 |
2 similar comments
+1 |
+1 |
Hi This is not clear to me... export type LoadChildren = string | LoadChildrenCallback; Si there is no violation there... Is it specific to VS2015? What's the TS version? |
@shlomiassaf According to the current Angular documentation, type LoadChildrenCallback = () =>
Type<any>| NgModuleFactory<any>| Promise<Type<any>>| Observable<Type<any>>; Assigning |
Assigning lambda will also break AoT... So just avoid it? |
I'm having the same issue... |
I had the same issue, I am on Angular 5.2.1. Try to explicit declare the variable route:
then update the variable that you are using for example:
|
Hi there,
I'm getting the above error when I'm configuring my routes. I'm following the docs exactly as described, but the lamba expression fails the Typescript intellisense (in VS2015) and the build process does not complete.
I'm using ng-router-loader 2.1.0 and angular 4.1.2 (angular/router 4.1.2).
The specific error is this:
Type '{ path: string; loadChildren: () => string; }' is not assignable to type 'Route'.
My code is basically this: { path: 'sales', loadChildren: './sales.module#SalesModule' },
I realise this isn't likely to be ng-router-loader's problem, but that is the specific format the documentation says to use, so I'm starting here :)
Do I need to match a specific version of angular or similar?
Thanks.
The text was updated successfully, but these errors were encountered: