Gradient Able Angular
  • ✨Introduction
  • 🚀Quick Installation
  • 📂File Structure
  • 📄Page Structure
  • 🛠️Theme Configuration
  • 🎨Theme Layouts
  • 📦Dependencies
  • ✏️How to
    • Dashboard as First Page
    • Login as First Page
    • Remove Role Base Authentication
    • Remove Authentication
    • Guard Children Routes
    • Role-Based Authentication
  • 📅Changelog
  • 🆘Support
Powered by GitBook
On this page

Was this helpful?

  1. How to

Dashboard as First Page

How to set Dashboard as First page instead landing

This section explains how to set the Dashboard page as the default starting page, skipping the landing page, for cases where it is not needed.

AuthGuard is removed from routes to avoid login checks.

  1. Update route at: src/app/app-routing.module.ts

src/app/app-routing.module.ts
// angular import
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

// project import
import { AdminComponent } from './theme/layout/admin/admin.component';
import { GuestComponent } from './theme/layout/guest/guest.component';
import { AuthGuardChild } from './theme/shared/_helpers/auth.guard';
import { Role } from './theme/shared/_helpers/role';

const routes: Routes = [
{
    path: '',
    component: AdminComponent,
    // canActivateChild: [AuthGuardChild],
    children: [
      {
        path: '',
        redirectTo: '/dashboard/analytics',
        pathMatch: 'full'
      },
      {
        path: '',
        loadComponent: () => import('./demo/dashboard/dash-analytics/dash-analytics.component').then((c) => c.DashAnalyticsComponent),
        data: { roles: [Role.Admin, Role.User] }
      },
      {
        path: 'dashboard',
        loadChildren: () => import('./demo/dashboard/dashboard.module').then((m) => m.DashboardModule),
        data: { roles: [Role.Admin, Role.User] }
      },
      ...
      ]
      ...
      ...
  },
  {
    path: '',
    component: GuestComponent,
    children: [
    ....
    ]
  }
]
PreviousHow toNextLogin as First Page

Last updated 5 months ago

Was this helpful?

✏️