BeastCode / VSCode-Angular-TypeScript-Snippets

Visual Studio Code TypeScript snippets (TypeScript, Html, Angular Material, Flex Layout, ngRx, RxJS & Testing) for Angular 17
https://marketplace.visualstudio.com/items?itemName=Mikael.Angular-BeastCode
MIT License
92 stars 49 forks source link

Add support for module routing (also feature modules) #15

Closed mackelito closed 7 years ago

mackelito commented 7 years ago

When creating a new "modulename-routing-module.ts" file it would be great to have 2 templates.

  1. RouterModule.forRoot
    
    export const routes: Routes = [
    { path: '', redirectTo: 'user', pathMatch: 'full' },
    { path: 'my-account', redirectTo: 'my-account', pathMatch: 'full' }
    ];

@NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) export class AppRoutingModule { }


2. RouterModule.forChild (feature modules)

@NgModule({ imports: [RouterModule.forChild([ { path: 'my-account', component: UserComponent, children: [ { path: '', component: DashBoardComponent }, ] }, ])], exports: [RouterModule] })

BeastCode commented 7 years ago

Will add when I'm back from ng-conf.

Tack /Micke

mackelito commented 7 years ago

... ng-conf... you bastard! ;)

BeastCode commented 7 years ago

Hahaha. Sorry, didn't mean to make you jealous, just wanted let you know that I'm not ignoring your suggestion.

BeastCode commented 7 years ago

Fixed in 4.0.8: ng-router-appmodule ng-router-featuremodule