How to use the nativescript-angular/router.NativeScriptRouterModule.forRoot 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 / tests / app / main.ts View on Github external
@NgModule({
    bootstrap: [
        LazyLoadMain
    ],
    declarations: [
        LazyLoadMain,
        FirstComponent,
    ],
    entryComponents: [
        LazyLoadMain,
    ],
    imports: [
        NativeScriptModule,
        NativeScriptFormsModule,
        NativeScriptRouterModule,
        NativeScriptRouterModule.forRoot(lazyLoadRoutes),
    ],
    exports: [
        NativeScriptModule,
        NativeScriptFormsModule,
        NativeScriptRouterModule,
    ],
    providers: [
        rootViewProvider,
        lazyLoadHooksLogProvider,
        { provide: NgModuleFactoryLoader, useClass: NSModuleFactoryLoader },
    ]
})
class LazyLoadModule { }

application.start({
    create: (): Page => {
github nstudio / nativescript-camera-plus / demo-ng / app / app.routing.ts View on Github external
import { NgModule } from '@angular/core';
import { Routes } from '@angular/router';
import { NativeScriptRouterModule } from 'nativescript-angular/router';
import { CaptureComponent } from './capture/capture.component';

const routes: Routes = [
  { path: '', redirectTo: '/capture', pathMatch: 'full' },
  { path: 'capture', component: CaptureComponent }
];

@NgModule({
  imports: [NativeScriptRouterModule.forRoot(routes)],
  exports: [NativeScriptRouterModule]
})
export class AppRoutingModule {}
github anihalaney / rwa-trivia / projects / trivia / src / app / app-routing.module.tns.ts View on Github external
path: 'game-play',
        loadChildren: './game-play/game-play.module#GamePlayModule',
        canActivate: [AuthGuard],
        resolve: { 'categories': CategoriesResolver, 'tags': TagsResolver }
    },
    {
        path: 'my',
        loadChildren: './user/user.module#UserModule',
        canActivate: [AuthGuard],
        resolve: { 'categories': CategoriesResolver, 'tags': TagsResolver }
    },

];

@NgModule({
    imports: [NativeScriptRouterModule.forRoot(routes)],
    exports: [NativeScriptRouterModule]
})
export class AppRoutingModule { }
github nstudio / nativescript-checkbox / demo-ng / app / app.routing.ts View on Github external
import { NgModule } from '@angular/core';
import { Routes } from '@angular/router';
import { NativeScriptRouterModule } from 'nativescript-angular/router';
import { ItemDetailComponent } from './item/item-detail.component';
import { ItemsComponent } from './item/items.component';

const routes: Routes = [
  { path: '', redirectTo: '/items', pathMatch: 'full' },
  { path: 'items', component: ItemsComponent },
  { path: 'item/:id', component: ItemDetailComponent }
];

@NgModule({
  imports: [NativeScriptRouterModule.forRoot(routes)],
  exports: [NativeScriptRouterModule]
})
export class AppRoutingModule {}
github NativeScript / nativescript-angular / ng-sample / app / app.ts View on Github external
function makeExampleModule(componentType) {
    let imports: any[] = [NativeScriptAnimationsModule, ExampleModule];
    if (componentType.routes) {
        imports.push(NativeScriptRouterModule.forRoot(componentType.routes));
    }
    let exports: any[] = [];
    if (componentType.exports) {
        exports = componentType.exports;
    }
    let entries = [];
    if (componentType.entries) {
        entries = componentType.entries;
    }
    entries.push(componentType);

    let providers = [{ provide: ErrorHandler, useClass: MyErrorHandler }];
    if (componentType.providers) {
        providers = [...providers, componentType.providers];
    }
github JoshDSommer / nativescript-ngx-slides / demo / app / app-routing.module.ts View on Github external
import { NgModule } from "@angular/core";
import { Routes } from "@angular/router";
import { NativeScriptRouterModule } from "nativescript-angular/router";

const routes: Routes = [
    { path: "", redirectTo: "/home", pathMatch: "full" },
    { path: "home", loadChildren: "./home/home.module#HomeModule" }
];

@NgModule({
    imports: [NativeScriptRouterModule.forRoot(routes)],
    exports: [NativeScriptRouterModule]
})
export class AppRoutingModule { }
github RafaelSNascimento / NativeScriptChat / chatNativeScriptApp / app / app.module.ts View on Github external
@NgModule({
  declarations: [
    AppComponent,
    ChatComponent,
    ChatBoxComponent,
    LoginComponent
  ],
  bootstrap: [AppComponent],
  imports: [
    NativeScriptModule,
    NativeScriptFormsModule,
    NativeScriptHttpModule,
    NativeScriptRouterModule,
    ReactiveFormsModule,
    NativeScriptUIListViewModule,
    NativeScriptRouterModule.forRoot(routes)
  ],
  providers: [ UserChatService, CommonFunctionsService, SingletonService, SocketService,  FormBuilder ],
  schemas: [NO_ERRORS_SCHEMA],
})
export class AppModule {}
github NativeScript / nativescript-app-templates / packages / template-hello-world-ng / src / app / app-routing.module.ts View on Github external
import { NgModule } from "@angular/core";
import { NativeScriptRouterModule } from "nativescript-angular/router";
import { Routes } from "@angular/router";

import { ItemsComponent } from "./item/items.component";
import { ItemDetailComponent } from "./item/item-detail.component";

const routes: Routes = [
    { path: "", redirectTo: "/items", pathMatch: "full" },
    { path: "items", component: ItemsComponent },
    { path: "item/:id", component: ItemDetailComponent }
];

@NgModule({
    imports: [NativeScriptRouterModule.forRoot(routes)],
    exports: [NativeScriptRouterModule]
})
export class AppRoutingModule { }
github NativeScript / nativescript-angular / e2e / animation-examples / app / app.routing.ts View on Github external
const routes: Routes = [
    { path: "", pathMatch: "full", redirectTo: "list" },
    { path: "list", component: AnimationsListComponent },
    { path: "builder", component: AnimationBuilderComponent },
    { path: "external", component: ExternalAnimationComponent },
    { path: "fade-in-out", component: FadeInOutComponent },
    { path: "options", component: OptionsComponent },
    { path: "options-default", component: OptionsDefaultComponent },
    { path: "animate-child", component: AnimateChildComponent },
    { path: "selector", component: SelectorAllComponent },
    { path: "query-stagger", component: QueryStaggerComponent },
    { path: "hero", loadChildren: "./hero/hero.module#HeroModule" },
];

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

export const routedComponents = [
    AnimationsListComponent,
    AnimationBuilderComponent,
    ExternalAnimationComponent,
    FadeInOutComponent,
    OptionsComponent,
    OptionsDefaultComponent,
    AnimateChildComponent,
    SelectorAllComponent,
    QueryStaggerComponent,
];
github dotnetdreamer / nativescript-http-formdata / TNSHttpFormData / demo-angular / src / app / app-routing.module.ts View on Github external
import { NgModule } from "@angular/core";
import { Routes } from "@angular/router";
import { NativeScriptRouterModule } from "nativescript-angular/router";

const routes: Routes = [
    { path: "", redirectTo: "/home", pathMatch: "full" },
    { path: "home", loadChildren: "~/app/home/home.module#HomeModule" }
];

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