@angular/router#Routes TypeScript Examples

The following examples show how to use @angular/router#Routes. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: app-routing.module.ts    From one-platform with MIT License 6 votes vote down vote up
routes: Routes = [
  {
    path: 'playground',
    loadChildren: () =>
      import('./playground/playground.module').then((m) => m.PlaygroundModule),
  },
  {
    path: 'leaderboard',
    loadChildren: () =>
      import('./leaderboard/leaderboard.module').then(
        (m) => m.LeaderboardModule
      ),
  },
  {
    path: '',
    loadChildren: () =>
      import('./dashboard/dashboard.module').then((m) => m.DashboardModule),
  },
]
Example #2
Source File: app-routing.module.ts    From 1hop with MIT License 6 votes vote down vote up
routes: Routes = [
    {
        path: '',
        component: BaseComponent,
        children: [
            {
                path: '',
                component: MigrationComponent
            },
            {
                path: 'import/:provider',
                component: ImportComponent
            },
            {
                path: 'migrate/:provider',
                component: MigrateComponent
            },
            {
                path: 'manage',
                component: ManageComponent
            },
            {
                path: 'how-it-works',
                component: HowItWorksComponent
            }
        ]
    },
    {
        path: '**',
        component: NoContentComponent
    }
]
Example #3
Source File: app-routing.module.ts    From 1x.ag with MIT License 6 votes vote down vote up
routes: Routes = [
    {
        path: '',
        component: BaseComponent,
        children: [
            {
                path: '',
                loadChildren: () => import('./leverage/leverage.module').then(m => m.LeverageModule)
            },
            {
                path: 'how-it-works',
                component: HowItWorksComponent
            },
        ]
    },
    {
        path: '**',
        component: NoContentComponent
    }
]
Example #4
Source File: home-routing.module.ts    From Uber-ServeMe-System with MIT License 6 votes vote down vote up
routes: Routes = [
  {
    path: '',
    component: HomePage,
    children: [
      {
        path: 'feed',
        canActivate: [AuthGuard],
        loadChildren: () =>
          import('../pages/feed/feed.module').then(m => m.FeedPageModule)
      },
      {
        path: 'collections',
        loadChildren: () =>
          import('../pages/collections/collections.module').then(m => m.CollectionsPageModule)
      },
      {
        path: 'history',
        loadChildren: () =>
          import('../pages/history/history.module').then(m => m.HistoryPageModule)
      },
      {
        path: 'me',
        loadChildren: () =>
          import('../pages/me/me.module').then(m => m.MePageModule)
      },
    ]
  },
  {
    path: '',
    redirectTo: 'feed',
  }
]
Example #5
Source File: app-routing.module.ts    From bdc-walkthrough with MIT License 6 votes vote down vote up
routes: Routes = [
  { path: 'example1', component: Example1Component },
  { path: 'example2', component: Example2Component },
  { path: 'example3', component: Example3Component },
  { path: 'example4', component: Example4Component },
  { path: 'example5', component: Example5Component },
  { path: 'example6', component: Example6Component },
  { path: 'example7', component: Example7Component },
  { path: '', redirectTo: '/example1', pathMatch: 'full' }
]
Example #6
Source File: app-routing.module.ts    From Smersh with MIT License 6 votes vote down vote up
routes: Routes = [
  {
    path: 'login',
    component: LoginComponent,
  },
  new MissionResource().generateResource(),
  new UserResource().generateResource(),
  new VulnResource().generateResource(),
  new HostResource().generateResource(),
  new ImpactResource().generateResource(),
  {
    path: 'conclusion',
    component: SideBarComponent,
    canActivate: [AuthGuard],
    children: [
      {
        path: 'generate',
        component: ConclusionComponent,
      },
    ],
  },
  new ClientResource().generateResource(),
  new HostVulnResource().generateResource(),

  // otherwise redirect to home
  {
    path: '404',
    component: ErrorsComponent,
  },
  {
    path: '',
    component: HomepageComponent,
  },
  {
    path: '**',
    component: ErrorsComponent,
  },
]
Example #7
Source File: connect-routing.module.ts    From xBull-Wallet with GNU Affero General Public License v3.0 6 votes vote down vote up
routes: Routes = [
  {
    path: '',
    component: ConnectDashboardComponent,
    canActivate: [
      CanAccessConnectGuard,
    ],
  },
  {
    path: 'no-wallet',
    component: ConnectNoWalletComponent,
  }
]
Example #8
Source File: liquidity-providing-routing.module.ts    From rubic-app with GNU General Public License v3.0 6 votes vote down vote up
routes: Routes = [
  {
    path: '',
    component: LpPageComponent,
    canActivate: [LpRoundTimeGuard]
  },
  {
    path: 'deposit',
    component: DepositFormComponent,
    canActivate: [LpRoundTimeGuard]
  }
]
Example #9
Source File: app-routing.module.ts    From ng-devui-admin with MIT License 6 votes vote down vote up
routes: Routes = [
  {
    path: 'pages',
    loadChildren: () =>
      import('./pages/pages.module').then((m) => m.PagesModule),
    canActivate: [AuthGuardService],
  },
  {
    path: 'login',
    component: LoginComponent,
  },
  {
    path: 'register',
    component: RegisterComponent,
  },
  {
    path: '',
    redirectTo: 'pages',
    pathMatch: 'full',
  },
  {
    path: '**',
    redirectTo: 'pages',
  },
]
Example #10
Source File: settings-routing.module.ts    From RcloneNg with MIT License 6 votes vote down vote up
routes: Routes = [
	{
		path: '',
		component: SettingsComponent,
		children: [
			{ path: 'server', component: SeverSettingComponent },
			{ path: 'browser', component: BrowserSettingComponent },
			{ path: '', redirectTo: 'server', pathMatch: 'full' },
		],
	},
]
Example #11
Source File: app-routing.module.ts    From FireAdmin with MIT License 6 votes vote down vote up
routes: Routes = [
  {
    path: 'demo',
    //loadChildren: () => import('fire-admin').then(m => m.FireAdminModule)
    loadChildren: () => import('projects/fire-admin/src/public-api').then(m => m.FireAdminModule)
  },
  {
    path: '**',
    redirectTo: 'demo'
  }
]
Example #12
Source File: app-routing.module.ts    From ng-conf-2020-workshop with MIT License 6 votes vote down vote up
routes: Routes = [
  { path: '', redirectTo: '/home', pathMatch: 'full' },
  { path: 'home', component: HomeComponent, data: { text: 'Home' } },
  { path: 'orders-v1', component: OrdersV1Component, data: { text: 'Orders V1' } },
  { path: 'error', component: UncaughtErrorComponent },
  { path: 'orders', component: OrdersComponent, data: { text: 'Orders' } },
  { path: 'company-stocks', component: CompanyStocksComponent, data: { text: 'Company Stocks' } },
  { path: 'customers', component: CustomersComponent, data: { text: 'Customers' } },
  { path: '**', component: PageNotFoundComponent } // must always be last
]
Example #13
Source File: app-routing.module.ts    From canopy with Apache License 2.0 6 votes vote down vote up
routes: Routes = [
  {
    path: 'tab-1',
    component: StoryContentComponent,
  },
  {
    path: 'tab-2',
    component: StoryContentComponent,
  },
  {
    path: 'tab-3',
    component: StoryContentComponent,
  },
  {
    path: 'side-nav-1',
    component: StoryContentComponent,
    outlet: "side-nav"
  },
  {
    path: 'side-nav-2',
    component: StoryContentComponent,
    outlet: "side-nav"
  },
  {
    path: 'side-nav-3',
    component: StoryContentComponent,
    outlet: "side-nav"
  },
  {
    path: 'side-nav-4',
    component: StoryContentComponent,
    outlet: "side-nav"
  },
  {
    path: '',
    redirectTo: 'tab-1',
    pathMatch: 'full',
  },
]
Example #14
Source File: app-routing.module.ts    From mylog14 with GNU General Public License v3.0 6 votes vote down vote up
routes: Routes = [
  {
    path: '',
    loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
  },
  {
    path: 'onboarding',
    loadChildren: () => import('./onboarding/onboarding.module').then(m => m.OnboardingPageModule)
  },
]
Example #15
Source File: app-routing.module.ts    From nica-os with MIT License 6 votes vote down vote up
routes: Routes = [
  {
    path: '',
    component: NicaOSComponent,
    resolve: {
      assets: AssetsResolver
    }
  },
  {
    path: '**',
    redirectTo: ''
  }
]
Example #16
Source File: app-routing.module.ts    From msfs-community-downloader with GNU Affero General Public License v3.0 6 votes vote down vote up
routes: Routes = [
    {
        path: '',
        redirectTo: 'home',
        pathMatch: 'full'
    },  
    {
        path: '**',
        component: PageNotFoundComponent
    }
]
Example #17
Source File: app-routing.module.ts    From TheHungryRecipesApp with GNU General Public License v3.0 6 votes vote down vote up
routes: Routes = [
  {
    path: 'login',
    component: LoginComponent
  },
  { path: '', loadChildren: () => import('./components/landing/landing.module').then(m => m.LandingModule) },
  { path: 'random', loadChildren: () => import('./components/randomrecipe/randomrecipe.module').then(m => m.RandomrecipeModule) },
  { path: 'landing', loadChildren: () => import('./components/landing/landing.module').then(m => m.LandingModule) },
  { path: 'about', loadChildren: () => import('./components/about/about.module').then(m => m.AboutModule) },
  { path: 'category', loadChildren: () => import('./components/category/category.module').then(m => m.CategoryModule) },
  { path: 'recipe', loadChildren: () => import('./components/recipe/recipe.module').then(m => m.RecipeModule) },
  { path: 'recipelist', loadChildren: () => import('./components/recipelist/recipelist.module').then(m => m.RecipelistModule) }
]
Example #18
Source File: app-routing.module.ts    From BetterCrewlink-mobile with GNU General Public License v3.0 6 votes vote down vote up
routes: Routes = [
	{
		path: '',
		redirectTo: 'settings',
		pathMatch: 'full',
	},
	{
		path: 'game',
		component: GameComponent,
	},
	{
		path: 'settings',
		component: SettingsComponent,
	},
	{ path: '**', redirectTo: '/settings', pathMatch: 'full' },
]
Example #19
Source File: app-routing.module.ts    From barista with Apache License 2.0 6 votes vote down vote up
routes: Routes = [
  { path: '', redirectTo: '/home', pathMatch: 'full' },
  { path: 'project', redirectTo: '/home', pathMatch: 'full' },
  {
    path: 'status',
    component: StatusComponent,
    data: { showHeader: false, showSidebar: false, showFooter: false },
  },
  {
    path: 'signin',
    component: SigninComponent,
    data: { showHeader: true, showSidebar: false },
  },
  {
    path: 'signup',
    component: SignupComponent,
    data: { showHeader: false, showSidebar: false },
  },
  {
    path: 'home',
    component: HomeComponent,
    data: { showHeader: true, showSidebar: false, showFooter: true },
  },
]
Example #20
Source File: app-routing.module.ts    From Angular-Cookbook with MIT License 6 votes vote down vote up
routes: Routes = [{
  path: '',
  pathMatch: 'full',
  redirectTo: 'auth'
}, {
  path: 'auth',
  loadChildren: () => import('./auth/auth.module').then(m => m.AuthModule)
}, {
  path: 'admin',
  loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule),
  canActivate: [AuthGuard]
}, {
  path: 'employee',
  loadChildren: () => import('./employee/employee.module').then(m => m.EmployeeModule),
  canActivate: [AuthGuard]
}]
Example #21
Source File: app-routing.module.ts    From Developing-Multi-platform-Apps-with-Visual-Studio-Code with MIT License 6 votes vote down vote up
routes: Routes = [
  { path:'home', component: HomeComponent },
  { path: '', redirectTo:'home', pathMatch:'full'},
  {
    path: 'login',
    loadChildren: () => import('./login/login.module').then(module=>module.LoginModule)
  },
  {
    path: 'jobrequest',
    loadChildren:() => import('./jobrequest/jobrequest.module').then(module=>module.JobrequestModule),
    canActivate:[JobrequestGuard]

  },
  {
    path: 'agent',
    loadChildren:() => import('./agent/agent.module').then(module=>module.AgentModule),
    canActivate: [AgentGuard]
  }    
]
Example #22
Source File: app-routing.module.ts    From pantry_party with Apache License 2.0 6 votes vote down vote up
routes: Routes = [
  {
    path: "",
    redirectTo: "/scan/purchase",
    pathMatch: "full"
  },
  {
    path: "stock",
    loadChildren: () => import("~/app/features/stock/stock.module").then(m => m.StockModule),
    canActivate: [ApplicationIsSetup]
  },
  {
    path: "scan",
    loadChildren: () => import("~/app/features/scan/scan.module").then(m => m.ScanModule),
    canActivate: [ApplicationIsSetup]
  },
  {
    path: "locations",
    loadChildren: () =>
      import("~/app/features/location-managment/location-managment.module")
      .then(m => m.LocationManagmentModule),
    canActivate: [ApplicationIsSetup]
  },
  {
    path: "products",
    loadChildren: () =>
      import("~/app/features/product-managment/product-managment.module")
      .then(m => m.ProductManagmentModule),
    canActivate: [ApplicationIsSetup]
  },
  {
    path: "initialSetup",
    loadChildren: () => import("~/app/features/setup-wizard/setup-wizard.module").then(m => m.SetupWizardModule)
  },
  {
    path: "settings",
    loadChildren: () => import("~/app/features/settings/settings.module").then(m => m.SettingsModule)
  }
]
Example #23
Source File: app-routing.module.ts    From scion-microfrontend-platform with Eclipse Public License 2.0 6 votes vote down vote up
routes: Routes = [
  {path: '', redirectTo: 'apps', pathMatch: 'full'},
  {
    path: 'find-capabilities',
    children: [
      {path: '', component: FindCapabilitiesComponent},
      {path: 'filter-results', component: CapabilityFilterResultComponent, outlet: 'details'},
    ],
  },
  {
    path: 'apps',
    children: [
      {path: '', component: AppListComponent},
      {path: ':appSymbolicName', component: AppDetailsComponent, outlet: 'details'},
    ],
  },
]
Example #24
Source File: admin-routing.module.ts    From App with MIT License 6 votes vote down vote up
routes: Routes = [
	{
		path: '',
		data: { title: 'Admin' },
		component: AdminComponent,
		canActivate: [AdminGuard],
		canActivateChild: [AdminGuard],
		children: [
			{
				path: '',
				redirectTo: 'users'
			},
			{
				path: 'users',
				data: { title: 'Admin - Users', breadcrumb: 'Users' },
				component: AdminUsersComponent
			},
			{
				path: 'audit',
				data: { title: 'Admin - Reports' },
				component: AdminReportsComponent
			},
			{
				path: 'modq',
				component: AdminModQueueComponent,
				data: { title: 'Admin - Mod Queue' }
			}
		]
	}
]
Example #25
Source File: leaderboard-routing.module.ts    From one-platform with MIT License 5 votes vote down vote up
routes: Routes = [
  {
    path: '',
    component: LeaderboardComponent,
  },
]
Example #26
Source File: app-routing.module.ts    From gnosis.1inch.exchange with MIT License 5 votes vote down vote up
routes: Routes = []
Example #27
Source File: app-routing.module.ts    From Uber-ServeMe-System with MIT License 5 votes vote down vote up
routes: Routes = [
  {
    path: '',
    redirectTo: 'login', pathMatch: 'full',
  },
  { 
    path: 'home', 
    loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
  },
  {
    path: 'login',
    canActivate: [LoginGuard],
    loadChildren: () => import('./pages/login/login.module').then( m => m.LoginPageModule)
  },
  {
    path: 'register',
    loadChildren: () => import('./pages/register/register.module').then( m => m.RegisterPageModule)
  },
  {
    path: 'vendor',
    loadChildren: () => import('./pages/vendor/vendor.module').then( m => m.VendorPageModule)
  },
  {
    path: 'service-detail',
    loadChildren: () => import('./pages/service-detail/service-detail.module').then( m => m.ServiceDetailPageModule)
  },
  {
    path: 'service-detail/:id',
    loadChildren: () => import('./pages/service-detail/service-detail.module').then( m => m.ServiceDetailPageModule)
  },
  {
    path: 'add-service',
    loadChildren: () => import('./pages/add-service/add-service.module').then( m => m.AddServicePageModule)
  },
  {
    path: 'vendor-request',
    loadChildren: () => import('./pages/vendor-request/vendor-request.module').then( m => m.VendorRequestPageModule)
  },
  {
    path: 'vendor-location',
    loadChildren: () => import('./pages/vendor-location/vendor-location.module').then( m => m.VendorLocationPageModule)
  },
  {
    path: 'place-request',
    loadChildren: () => import('./pages/place-request/place-request.module').then( m => m.PlaceRequestPageModule)
  },
  {
    path: 'place-request/:id',
    loadChildren: () => import('./pages/place-request/place-request.module').then( m => m.PlaceRequestPageModule)
  },
  {
    path: 'review',
    loadChildren: () => import('./pages/review/review.module').then( m => m.ReviewPageModule)
  },
  {
    path: 'search-display',
    loadChildren: () => import('./modal/search-display/search-display.module').then( m => m.SearchDisplayPageModule)
  },
  {
    path: 'review/:id',
    loadChildren: () => import('./pages/review/review.module').then( m => m.ReviewPageModule)
  },
  {
    path: 'service-filter',
    loadChildren: () => import('./modal/service-filter/service-filter.module').then( m => m.ServiceFilterPageModule)
  },
]