Skip to content
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

Support for loadComponent and loadChildren #23

Open
silk-bahamut opened this issue Mar 25, 2024 · 1 comment
Open

Support for loadComponent and loadChildren #23

silk-bahamut opened this issue Mar 25, 2024 · 1 comment
Assignees

Comments

@silk-bahamut
Copy link

I don't know if it's the new way to export the routes in Angular 16 but the following codes

import { provideRouter, Routes } from '@angular/router';
import { EnvironmentProviders } from '@angular/core';

const routes: Routes = [
  {
    path: 'admin',
    loadChildren: () => import('../app/admin/admin.routes'),
  },
{
    path: 'sample1',
    loadComponent: () => import('./component/sample1.component')
       .then((s) => s.Sample1Component),
}
];

export const routerProvider = (): EnvironmentProviders => provideRouter(routes);
import { Routes } from '@angular/router';

export default [
{
    path: 'sample2',
    loadComponent: () => import('./component/sample2.component')
       .then((s) => s.Sample2Component),
}
] satisfies Routes;

reports Sample1Component and Sample2Component as unused when analysed.

@wgrabowski
Copy link
Owner

Thanks, I didn't cover that case.

@wgrabowski wgrabowski self-assigned this Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants