Base solution for your next web application
Open Closed

Add New Routing Medule #2942


User avatar
0
haithamsakr created

i add the new "Pos" module { path: 'main', loadChildren: 'app/main/main.module#MainModule', //Lazy load main module data: { preload: true } }, { path: 'admin', loadChildren: 'app/admin/admin.module#AdminModule', //Lazy load admin module data: { preload: true } }, { path: 'pos', loadChildren: 'app/pos/pos.module#PosModule', //Lazy load pos module data: { preload: true } }

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';

import { ModalModule, TabsModule, TooltipModule } from 'ng2-bootstrap';
import { FileUploadModule } from '@node_modules/ng2-file-upload';

import { PosRoutingModule } from './pos-routing.module'
import { UtilsModule } from '@shared/utils/utils.module'
import { AppCommonModule } from '@app/shared/common/app-common.module'


import { StoresComponent } from './Basic-Data/Stores/Stores.component';



@NgModule({
    imports: [
        FormsModule,
        CommonModule,

        FileUploadModule,
        ModalModule.forRoot(),
        TabsModule.forRoot(),
        TooltipModule.forRoot(),

        PosRoutingModule,
        UtilsModule,
        AppCommonModule
    ],
    declarations: [
        StoresComponent
    ]
})
export class PosModule { }
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { StoresComponent } from './Basic-Data/Stores/Stores.component';
@NgModule({
    imports: [
        RouterModule.forChild([
            {
                path: '',
                children: [
                    { path: 'Stores', component: StoresComponent, data: { permission: 'Pages.Administration.Users' } }
                ]
            }
        ])
    ],
    exports: [
        RouterModule
    ]
})
export class PosRoutingModule { }

and in side bar component

new SideBarMenuItem("Basic Data", "Pages.BasicData", "icon-list", "", [
                new SideBarMenuItem("Store", "Pages.BasicData.Stores", "icon-link", "/app/pos/Basic-Data/Stores"),

but still i got Error: Cannot match any routes. URL Segment: 'app/pos/Basic-Data/Stores'


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I think you need to define menu item like this.

    new SideBarMenuItem("Store", "Pages.BasicData.Stores", "icon-link", "/app/pos/Stores"),
    

    Can you try that ?

    Thanks

  • User Avatar
    0
    haithamsakr created

    thank you its worked your answer is OK

  • User Avatar
    0
    ismcagdas created
    Support Team

    Great :)