Angular 4 Route plus and sharp symbol meaning in main starter?

Repo https://github.com/AngularClass/angular-starter

enter image description here

I've seen all of these +

and #

for referencing within loadChildren

as well as naming within a folder ...

Goed to the angular link https://angular.io/api/router/LoadChildren didn't see ANYTHING about such a convention.

+3


source to share


1 answer


The hash (#) is part of the loadChildren syntax. It separates the path from the lazy loaded module from the class name of the lazy loaded module. Here's an example:

@NgModule({
    imports: [
        RouterModule.forRoot([
            { path: 'welcome', component: WelcomeComponent },
            {
                path: 'products',
                canActivate: [ AuthGuard ],
                data: { preload: true },
                loadChildren: 'app/products/product.module#ProductModule'
            },
            { path: '', redirectTo: 'welcome', pathMatch: 'full' },
            { path: '**', component: PageNotFoundComponent }
        ]
    ],
    exports: [ RouterModule ]
})
export class AppRoutingModule { }

      



The + character can be a character used in the folder name. I haven't seen this use before, but it might mean something for this particular command.

+3


source







All Articles