How to use the nativescript-angular/router.NativeScriptRouterModule.forChild function in nativescript-angular

To help you get started, we’ve selected a few nativescript-angular examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NativeScript / nativescript-angular / e2e / tests-app-ng / app / lazy / lazy.module.ts View on Github external
export function modalParamsFactory() {
    return new ModalDialogParams({}, null);
}

const routes: Routes = [
  {
    path: "",
    component: LazyComponent
  }
];

@NgModule({
  imports: [
    NativeScriptCommonModule,
    NativeScriptRouterModule.forChild(routes),
  ],
  declarations: [
    LazyComponent
  ],
  entryComponents: [
    LazyComponent
  ],
  providers: [
    // allows same component to be routed to
    // or lazily loaded via modal
    { provide: ModalDialogParams, useFactory: modalParamsFactory }
  ],
  schemas: [NO_ERRORS_SCHEMA]
})
export class LazyModule { }
github NativeScript / nativescript-sdk-examples-ng / app / ng-ui-category / modal-view-ng / modal-view-examples.module.ts View on Github external
children: [
            {
                path: "modal-view", component: ModalViewActionBarComponent
            }
        ]
    }
    // << modal-view-routes-actionbar
];

@NgModule({
    schemas: [NO_ERRORS_SCHEMA],
    imports: [
        TitleAndNavButtonModule,
        NativeScriptCommonModule,
        NativeScriptRouterModule,
        NativeScriptRouterModule.forChild(routerConfig)
    ],
    declarations: [
        ModalViewExamplesComponent,
        SampleModalViewModuleExampleComponent,
        ModalViewNavigationComponent,
        ModalViewComponent,
        HomeModalViewComponent,
        HomeModalViewContentComponent,
        SecondModalViewContentComponent,
        MainViewComponent,
        ModalRootComponent,
        ModalViewActionBarComponent
    ],
    entryComponents: [ModalViewComponent, HomeModalViewComponent, ModalRootComponent]
})
github NativeScript / nativescript-sdk-examples-ng / app / ui-category / slider / slider-examples.module.ts View on Github external
},
    {
        path: "value",
        component: SliderAccessValueComponent,
        data: { title: "Slider's value" }
    }
];

@NgModule({
    schemas: [NO_ERRORS_SCHEMA],
    imports: [
        TitleAndNavButtonModule,
        NativeScriptCommonModule,
        NativeScriptFormsModule,
        NativeScriptRouterModule,
        NativeScriptRouterModule.forChild(routerConfig)
    ],
    declarations: [
        SliderExamplesComponent,
        BasicSliderComponent,
        SliderAccessValueComponent
    ]
})

export class SliderExamplesModule {
    constructor() { }
}
github NativeScript / nativescript-sdk-examples-ng / app / ng-ui-widgets-category / htmlview / htmlview-examples.module.ts View on Github external
component: HtmlViewExamplesComponent
    },
    {
        path: "usage",
        component: HtmlViewUsageComponent,
        data: { title: "Usage" }
    }
];

@NgModule({
    schemas: [NO_ERRORS_SCHEMA],
    imports: [
        TitleAndNavButtonModule,
        NativeScriptCommonModule,
        NativeScriptRouterModule,
        NativeScriptRouterModule.forChild(routerConfig)
    ],
    declarations: [HtmlViewExamplesComponent, HtmlViewUsageComponent]
})

export class HtmlViewExamplesModule {
    constructor() { }
}
github NativeScript / nativescript-sdk-examples-ng / app / ng-framework-modules-category / platform / platform-examples.module.ts View on Github external
component: PlatformExamplesComponent
    },
    {
        path: "usage",
        component: PlatformModuleExampleComponent,
        data: { title: "Usage" }
    }
];

@NgModule({
    schemas: [NO_ERRORS_SCHEMA],
    imports: [
        TitleAndNavButtonModule,
        NativeScriptCommonModule,
        NativeScriptRouterModule,
        NativeScriptRouterModule.forChild(routerConfig)
    ],
    declarations: [
        PlatformExamplesComponent,
        PlatformModuleExampleComponent
    ]
})

export class PlatformExamplesModule {
    constructor() { }
}
github NativeScript / nativescript-sdk-examples-ng / app / ui-category / label / label-examples.module.ts View on Github external
component: LabelExamplesComponent
    },
    {
        path: "creating-label",
        component: CreatingLabelComponent,
        data: { title: "Create Label" }
    }
];

@NgModule({
    schemas: [NO_ERRORS_SCHEMA],
    imports: [
        TitleAndNavButtonModule,
        NativeScriptCommonModule,
        NativeScriptRouterModule,
        NativeScriptRouterModule.forChild(routerConfig)
    ],
    declarations: [
        LabelExamplesComponent,
        CreatingLabelComponent
    ]
})

export class LabelExamplesModule {
    constructor() { }
}
github NativeScript / nativescript-facebook / demo-angular / app / pages / home / home.module.ts View on Github external
import { HomeComponent } from "./home.component";
import { CommonModule } from "@angular/common";

import { NativeScriptFacebookModule } from "nativescript-facebook/angular";

export const routerConfig = [
    {
        path: "",
        component: HomeComponent
    }
];

@NgModule({
    imports: [
        NativeScriptRouterModule,
        NativeScriptRouterModule.forChild(routerConfig),
        CommonModule
    ],
    declarations: [ HomeComponent ],
    schemas: [ NO_ERRORS_SCHEMA ]
})
export class HomeModule { }
github NativeScript / nativescript-app-templates / packages / template-drawer-navigation-ng / src / app / settings / settings-routing.module.ts View on Github external
import { NgModule } from "@angular/core";
import { Routes } from "@angular/router";
import { NativeScriptRouterModule } from "nativescript-angular/router";

import { SettingsComponent } from "./settings.component";

const routes: Routes = [
    { path: "", component: SettingsComponent }
];

@NgModule({
    imports: [NativeScriptRouterModule.forChild(routes)],
    exports: [NativeScriptRouterModule]
})
export class SettingsRoutingModule { }
github NativeScript / nativescript-sdk-examples-ng / app / ui-category / listview / listview-examples.module.ts View on Github external
data: { title: "Using async pipe" }
    },
    {
        path: "update-child-component",
        component: UpdateChildComponent,
        data: { title: "Update child component" }
    }
];

@NgModule({
    schemas: [NO_ERRORS_SCHEMA],
    imports: [
        TitleAndNavButtonModule,
        NativeScriptCommonModule,
        NativeScriptRouterModule,
        NativeScriptRouterModule.forChild(routerConfig)
    ],
    declarations: [
        ItemComponent,
        ListViewExamplesComponent,
        CreatingListViewComponent,
        CustomizingListViewComponent,
        UsingAsyncPipeComponent,
        UpdateChildComponent
    ]
})

export class ListViewExamplesModule {
    constructor() { }
}
github NativeScript / nativescript-sdk-examples-ng / app / ui-category / search-bar / search-bar-examples.module.ts View on Github external
data: { title: "Clear SearchBar" }
    },
    {
        path: "binding",
        component: SearchBarBindingComponent,
        data: { title: "SearchBar property binding" }
    }
];

@NgModule({
    schemas: [NO_ERRORS_SCHEMA],
    imports: [
        TitleAndNavButtonModule,
        NativeScriptCommonModule,
        NativeScriptRouterModule,
        NativeScriptRouterModule.forChild(routerConfig)
    ],
    declarations: [
        SearchBarExamplesComponent,
        BasicSearchBarComponent,
        ClearSearchBarComponent,
        SearchBarBindingComponent
    ]
})

export class SearchBarExamplesModule {
    constructor() { }
}