Skip to content

Commit

Permalink
4-Módulos
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrotomassini committed Oct 7, 2022
1 parent 6e484bc commit 8aa19d4
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 44 deletions.
33 changes: 10 additions & 23 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,22 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { DashboardComponent } from './pages/dashboard/dashboard.component';
import { LoginComponent } from './auth/login/login.component';
import { RegisterComponent } from './auth/register/register.component';
import { ProgressComponent } from './pages/progress/progress.component';
import { Grafica1Component } from './pages/grafica1/grafica1.component';
import { NopagefoundComponent } from './pages/nopagefound/nopagefound.component';
import { PagesComponent } from './pages/pages.component';
import { PagesRoutingModule } from './pages/pages.routing';
import { AuthRoutingModule } from './auth/auth.routing';

const routes: Routes = [

{
path: '',
component: PagesComponent,
children: [
{ path: 'dashboard', component: DashboardComponent },
{ path: 'progress', component: ProgressComponent },
{ path: 'grafica1', component: Grafica1Component },
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' }
]
},

{ path: 'register', component: RegisterComponent },
{ path: 'login', component: LoginComponent },
import { NopagefoundComponent } from './nopagefound/nopagefound.component';

const routes: Routes = [
{path: '', redirectTo: '/dashboard', pathMatch: 'full'},
{ path: '**', component: NopagefoundComponent }
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [
RouterModule.forRoot(routes),
PagesRoutingModule,
AuthRoutingModule
],
exports: [RouterModule]
})
export class AppRoutingModule { }
27 changes: 7 additions & 20 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,25 @@ import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppRoutingModule } from './app-routing.module';
import { PagesModule } from './pages/pages.module';
import { AuthModule } from './auth/auth.module';

import { AppComponent } from './app.component';

import { LoginComponent } from './auth/login/login.component';
import { RegisterComponent } from './auth/register/register.component';

import { NopagefoundComponent } from './pages/nopagefound/nopagefound.component';
import { DashboardComponent } from './pages/dashboard/dashboard.component';
import { ProgressComponent } from './pages/progress/progress.component';
import { Grafica1Component } from './pages/grafica1/grafica1.component';
import { NopagefoundComponent } from './nopagefound/nopagefound.component';

import { BreadcrumbsComponent } from './shared/breadcrumbs/breadcrumbs.component';
import { SidebarComponent } from './shared/sidebar/sidebar.component';
import { HeaderComponent } from './shared/header/header.component';
import { PagesComponent } from './pages/pages.component';

@NgModule({
declarations: [
AppComponent,
LoginComponent,
RegisterComponent,
NopagefoundComponent,
DashboardComponent,
BreadcrumbsComponent,
SidebarComponent,
HeaderComponent,
ProgressComponent,
Grafica1Component,
PagesComponent
],
imports: [
BrowserModule,
AppRoutingModule
AppRoutingModule,
PagesModule,
AuthModule
],
providers: [],
bootstrap: [AppComponent]
Expand Down
22 changes: 22 additions & 0 deletions src/app/auth/auth.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { LoginComponent } from './login/login.component';
import { RegisterComponent } from './register/register.component';



@NgModule({
declarations: [
LoginComponent,
RegisterComponent,
],
exports: [
LoginComponent,
RegisterComponent,
],
imports: [
CommonModule
]
})
export class AuthModule { }
17 changes: 17 additions & 0 deletions src/app/auth/auth.routing.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Routes, RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';

import { RegisterComponent } from './register/register.component';
import { LoginComponent } from './login/login.component';


const routes: Routes = [
{ path: 'register', component: RegisterComponent },
{ path: 'login', component: LoginComponent }
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class AuthRoutingModule { }
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Error Page
.error-box {
height: 100%;
position: fixed;
background: url(../../../assets/images/background/error-bg.jpg) no-repeat center center #fff;
background: url(../../assets/images/background/error-bg.jpg) no-repeat center center #fff;
width: 100%;
}

Expand Down
32 changes: 32 additions & 0 deletions src/app/pages/pages.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';

import { SharedModule } from '../shared/shared.module';

import { DashboardComponent } from './dashboard/dashboard.component';
import { ProgressComponent } from './progress/progress.component';
import { Grafica1Component } from './grafica1/grafica1.component';
import { PagesComponent } from './pages.component';


@NgModule({
imports: [
CommonModule,
SharedModule,
RouterModule
],
declarations: [
DashboardComponent,
ProgressComponent,
Grafica1Component,
PagesComponent
],
exports: [
DashboardComponent,
ProgressComponent,
Grafica1Component,
PagesComponent
]
})
export class PagesModule { }
26 changes: 26 additions & 0 deletions src/app/pages/pages.routing.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Routes, RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';

import { DashboardComponent } from './dashboard/dashboard.component';
import { ProgressComponent } from './progress/progress.component';
import { Grafica1Component } from './grafica1/grafica1.component';
import { PagesComponent } from './pages.component';


const routes: Routes = [
{
path: 'dashboard',
component: PagesComponent,
children: [
{ path: '', component: DashboardComponent },
{ path: 'progress', component: ProgressComponent },
{ path: 'grafica1', component: Grafica1Component },
]
},
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class PagesRoutingModule { }
25 changes: 25 additions & 0 deletions src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { BreadcrumbsComponent } from './breadcrumbs/breadcrumbs.component';
import { SidebarComponent } from './sidebar/sidebar.component';
import { HeaderComponent } from './header/header.component';



@NgModule({
declarations: [
BreadcrumbsComponent,
SidebarComponent,
HeaderComponent,
],
exports: [
BreadcrumbsComponent,
SidebarComponent,
HeaderComponent,
],
imports: [
CommonModule
]
})
export class SharedModule { }

0 comments on commit 8aa19d4

Please sign in to comment.