diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 357b7fd..b0df9f8 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,20 +1,11 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router' -import { RecipesComponent } from './recipes/recipes.component'; import { ShoppingListComponent } from './shopping-list/shopping-list.component'; -import { RecipeDetailComponent } from './recipes/recipe-detail/recipe-detail.component'; -import { RecipeStartComponent } from './recipes/recipe-start/recipe-start.component'; -import { RecipeEditComponent } from './recipes/recipe-edit/recipe-edit.component'; -import { SignupComponent } from './auth/signup/signup.component'; -import { SigninComponent } from './auth/signin/signin.component'; -import { AuthGuard } from './auth/auth-guard.service'; const appRoutes: Routes = [ { path: '', redirectTo: '/recipes', pathMatch: 'full' }, - { path: 'shopping-list', component: ShoppingListComponent }, - { path: 'signup', component: SignupComponent }, - { path: 'signin', component: SigninComponent } + { path: 'shopping-list', component: ShoppingListComponent } ]; @NgModule({ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 2564994..e35e46b 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,41 +1,35 @@ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; import { HttpClientModule } from '@angular/common/http'; import { AppComponent } from './app.component'; import { HeaderComponent } from './header/header.component'; -import { ShoppingListComponent } from './shopping-list/shopping-list.component'; -import { ShoppingEditComponent } from './shopping-list/shopping-edit/shopping-edit.component'; import { ShoppingListService } from './shopping-list/shopping-list.service'; import { AppRoutingModule } from './app-routing.module'; import { RecipeService } from './recipes/recipe.service'; import { DataStorageService } from './shared/data-storage.service'; -import { SignupComponent } from './auth/signup/signup.component'; -import { SigninComponent } from './auth/signin/signin.component'; import { AuthService } from './auth/auth.service'; import { AuthGuard } from './auth/auth-guard.service'; import { RecipesModule } from './recipes/recipes.module'; import { SharedModule } from './shared/shared.module'; +import { ShoppingListModule } from './shopping-list/shopping-list.module'; +import { AuthModule } from './auth/auth.module'; @NgModule({ declarations: [ AppComponent, - HeaderComponent, - ShoppingListComponent, - ShoppingEditComponent, - SignupComponent, - SigninComponent + HeaderComponent ], imports: [ BrowserModule, - FormsModule, HttpClientModule, HttpModule, AppRoutingModule, RecipesModule, - SharedModule + SharedModule, + ShoppingListModule, + AuthModule ], providers: [ ShoppingListService, diff --git a/src/app/auth/auth-routing.module.ts b/src/app/auth/auth-routing.module.ts new file mode 100644 index 0000000..b7526d5 --- /dev/null +++ b/src/app/auth/auth-routing.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { SignupComponent } from './signup/signup.component'; +import { SigninComponent } from './signin/signin.component'; + +const authRoutes: Routes = [ + { path: 'signup', component: SignupComponent }, + { path: 'signin', component: SigninComponent } +] + +@NgModule({ + imports: [RouterModule.forChild(authRoutes)], + exports: [RouterModule] +}) +export class AuthRoutingModule { + +} \ No newline at end of file diff --git a/src/app/auth/auth.module.ts b/src/app/auth/auth.module.ts new file mode 100644 index 0000000..0ccec6d --- /dev/null +++ b/src/app/auth/auth.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; + +import { SignupComponent } from './signup/signup.component'; +import { SigninComponent } from './signin/signin.component'; +import { AuthRoutingModule } from './auth-routing.module'; + +@NgModule({ + declarations: [ + SignupComponent, + SigninComponent + ], + imports: [ + FormsModule, + AuthRoutingModule + ] +}) +export class AuthModule {} \ No newline at end of file diff --git a/src/app/shopping-list/shopping-list.module.ts b/src/app/shopping-list/shopping-list.module.ts new file mode 100644 index 0000000..c280a38 --- /dev/null +++ b/src/app/shopping-list/shopping-list.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule } from "@angular/forms"; + +import { ShoppingListComponent } from "./shopping-list.component"; +import { ShoppingEditComponent } from "./shopping-edit/shopping-edit.component"; + + + +@NgModule({ + declarations: [ + ShoppingListComponent, + ShoppingEditComponent + ], + imports: [ + CommonModule, + FormsModule + ] +}) +export class ShoppingListModule {} \ No newline at end of file