| @@ -1,20 +1,11 @@ | |||||
| import { NgModule } from '@angular/core'; | import { NgModule } from '@angular/core'; | ||||
| import { Routes, RouterModule } from '@angular/router' | import { Routes, RouterModule } from '@angular/router' | ||||
| import { RecipesComponent } from './recipes/recipes.component'; | |||||
| import { ShoppingListComponent } from './shopping-list/shopping-list.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 = [ | const appRoutes: Routes = [ | ||||
| { path: '', redirectTo: '/recipes', pathMatch: 'full' }, | { path: '', redirectTo: '/recipes', pathMatch: 'full' }, | ||||
| { path: 'shopping-list', component: ShoppingListComponent }, | |||||
| { path: 'signup', component: SignupComponent }, | |||||
| { path: 'signin', component: SigninComponent } | |||||
| { path: 'shopping-list', component: ShoppingListComponent } | |||||
| ]; | ]; | ||||
| @NgModule({ | @NgModule({ | ||||
| @@ -1,41 +1,35 @@ | |||||
| import { BrowserModule } from '@angular/platform-browser'; | import { BrowserModule } from '@angular/platform-browser'; | ||||
| import { NgModule } from '@angular/core'; | import { NgModule } from '@angular/core'; | ||||
| import { FormsModule } from '@angular/forms'; | |||||
| import { HttpModule } from '@angular/http'; | import { HttpModule } from '@angular/http'; | ||||
| import { HttpClientModule } from '@angular/common/http'; | import { HttpClientModule } from '@angular/common/http'; | ||||
| import { AppComponent } from './app.component'; | import { AppComponent } from './app.component'; | ||||
| import { HeaderComponent } from './header/header.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 { ShoppingListService } from './shopping-list/shopping-list.service'; | ||||
| import { AppRoutingModule } from './app-routing.module'; | import { AppRoutingModule } from './app-routing.module'; | ||||
| import { RecipeService } from './recipes/recipe.service'; | import { RecipeService } from './recipes/recipe.service'; | ||||
| import { DataStorageService } from './shared/data-storage.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 { AuthService } from './auth/auth.service'; | ||||
| import { AuthGuard } from './auth/auth-guard.service'; | import { AuthGuard } from './auth/auth-guard.service'; | ||||
| import { RecipesModule } from './recipes/recipes.module'; | import { RecipesModule } from './recipes/recipes.module'; | ||||
| import { SharedModule } from './shared/shared.module'; | import { SharedModule } from './shared/shared.module'; | ||||
| import { ShoppingListModule } from './shopping-list/shopping-list.module'; | |||||
| import { AuthModule } from './auth/auth.module'; | |||||
| @NgModule({ | @NgModule({ | ||||
| declarations: [ | declarations: [ | ||||
| AppComponent, | AppComponent, | ||||
| HeaderComponent, | |||||
| ShoppingListComponent, | |||||
| ShoppingEditComponent, | |||||
| SignupComponent, | |||||
| SigninComponent | |||||
| HeaderComponent | |||||
| ], | ], | ||||
| imports: [ | imports: [ | ||||
| BrowserModule, | BrowserModule, | ||||
| FormsModule, | |||||
| HttpClientModule, | HttpClientModule, | ||||
| HttpModule, | HttpModule, | ||||
| AppRoutingModule, | AppRoutingModule, | ||||
| RecipesModule, | RecipesModule, | ||||
| SharedModule | |||||
| SharedModule, | |||||
| ShoppingListModule, | |||||
| AuthModule | |||||
| ], | ], | ||||
| providers: [ | providers: [ | ||||
| ShoppingListService, | ShoppingListService, | ||||
| @@ -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 { | |||||
| } | |||||
| @@ -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 {} | |||||
| @@ -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 {} | |||||