All files / src/app app-routing.module.ts

100% Statements 21/21
100% Branches 0/0
100% Functions 0/0
100% Lines 19/19

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 2111x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x                                                                                                                                                                                                                                                                                                                                                                                           1x    
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { AdminLoginComponent } from './pages/admin-login/admin-login.component';
import { ArticleDetailComponent } from './pages/article-detail/article-detail.component';
import { ArticleListComponent } from './pages/article-list/article-list.component';
import { BlogDetailComponent } from './pages/blog-detail/blog-detail.component';
import { BlogListComponent } from './pages/blog-list/blog-list.component';
import { ContactComponent } from './pages/contact/contact.component';
import { HomeComponent } from './pages/home/home.component';
import { JokeDetailComponent } from './pages/joke-detail/joke-detail.component';
import { JokeListComponent } from './pages/joke-list/joke-list.component';
import { NotFoundComponent } from './pages/not-found/not-found.component';
import { PlaygroundComponent } from './pages/playground/playground.component';
import { QuoteDetailComponent } from './pages/quote-detail/quote-detail.component';
import { QuoteListComponent } from './pages/quote-list/quote-list.component';
import { SearchComponent } from './pages/search/search.component';
import { TaxonomyComponent } from './pages/taxonomy/taxonomy.component';
 
const routes: Routes = [
    // region home paths
    {
        path: '', redirectTo: 'home', pathMatch: 'full'
    },
    {
        path: 'home', component: HomeComponent
    },
    // endregion
    // region en-US paths
    {
        path: 'contact', component: ContactComponent
    },
    {
        path: 'blogs', redirectTo: 'blogs/1', pathMatch: 'full'
    },
    {
        path: 'blogs/:pageNo', component: BlogListComponent
    },
    {
        path: 'blog', redirectTo: 'blogs/1', pathMatch: 'full'
    },
    {
        path: 'blog/:id', component: BlogDetailComponent
    },
    {
        path: 'articles', redirectTo: 'articles/1', pathMatch: 'full'
    },
    {
        path: 'articles/:pageNo', component: ArticleListComponent
    },
    {
        path: 'article', redirectTo: 'articles/1', pathMatch: 'full'
    },
    {
        path: 'article/:id', component: ArticleDetailComponent
    },
    {
        path: 'jokes', redirectTo: 'jokes/1', pathMatch: 'full'
    },
    {
        path: 'jokes/:pageNo', component: JokeListComponent
    },
    {
        path: 'joke', redirectTo: 'jokes/1', pathMatch: 'full'
    },
    {
        path: 'joke/:id', component: JokeDetailComponent
    },
    {
        path: 'quotes', redirectTo: 'quotes/1', pathMatch: 'full'
    },
    {
        path: 'quotes/:pageNo', component: QuoteListComponent
    },
    {
        path: 'quote', redirectTo: 'quotes/1', pathMatch: 'full'
    },
    {
        path: 'quote/:id', component: QuoteDetailComponent
    },
    {
        path: 'tag/:id', component: TaxonomyComponent
    },
    // endregion
    // region tr-TR paths
    {
        path: 'iletisim', component: ContactComponent
    },
    {
        path: 'gunlukler', redirectTo: 'gunlukler/1', pathMatch: 'full'
    },
    {
        path: 'gunlukler/:pageNo', component: BlogListComponent
    },
    {
        path: 'gunluk', redirectTo: 'gunlukler/1', pathMatch: 'full'
    },
    {
        path: 'gunluk/:id', component: BlogDetailComponent
    },
    {
        path: 'makaleler', redirectTo: 'makaleler/1', pathMatch: 'full'
    },
    {
        path: 'makaleler/:pageNo', component: ArticleListComponent
    },
    {
        path: 'makale', redirectTo: 'makaleler/1', pathMatch: 'full'
    },
    {
        path: 'makale/:id', component: ArticleDetailComponent
    },
    {
        path: 'eglence', redirectTo: 'eglence/1', pathMatch: 'full'
    },
    {
        path: 'eglence/:pageNo', component: JokeListComponent
    },
    {
        path: 'fikralar', redirectTo: 'fikralar/1', pathMatch: 'full'
    },
    {
        path: 'fikralar/:pageNo', component: JokeListComponent
    },
    {
        path: 'fikra', redirectTo: 'eglence/1', pathMatch: 'full'
    },
    {
        path: 'fikra/:id', component: JokeDetailComponent
    },
    {
        path: 'saka', redirectTo: 'eglence/1', pathMatch: 'full'
    },
    {
        path: 'saka/:id', component: JokeDetailComponent
    },
    {
        path: 'espri', redirectTo: 'eglence/1', pathMatch: 'full'
    },
    {
        path: 'espri/:id', component: JokeDetailComponent
    },
    {
        path: 'soguk-espri', redirectTo: 'eglence/1', pathMatch: 'full'
    },
    {
        path: 'soguk-espri/:id', component: JokeDetailComponent
    },
    {
        path: 'alintilar', redirectTo: 'alintilar/1', pathMatch: 'full'
    },
    {
        path: 'alintilar/:pageNo', component: QuoteListComponent
    },
    {
        path: 'alinti', redirectTo: 'alintilar/1', pathMatch: 'full'
    },
    {
        path: 'alinti/:id', component: QuoteDetailComponent
    },
    {
        path: 'guzel-sozler', redirectTo: 'guzel-sozler/1', pathMatch: 'full'
    },
    {
        path: 'guzel-sozler/:pageNo', component: QuoteListComponent
    },
    {
        path: 'guzel-soz', redirectTo: 'guzel-sozler/1', pathMatch: 'full'
    },
    {
        path: 'guzel-soz/:id', component: QuoteDetailComponent
    },
    {
        path: 'etiket/:id', component: TaxonomyComponent
    },
    // endregion
    // region system-admin paths
    {
        path: 'search', component: SearchComponent
    },
    {
        path: 'playground', component: PlaygroundComponent
    },
    {
        path: 'admin-login', component: AdminLoginComponent
    },
    {
        path: 'http-404', component: NotFoundComponent
    },
    {
        path: '**', component: NotFoundComponent // maybe keeping current url is more cool, redirectTo: '404', pathMatch: 'full'
    }
    // endregion
];
 
/**
 * App Routing Module
 */
@NgModule({
    imports: [RouterModule.forRoot(routes, {
        // router options
        useHash: false,
        preloadingStrategy: PreloadAllModules,
        initialNavigation: 'enabled'
        // enableTracing: true // debugging purposes only
    })],
    exports: [RouterModule]
})
// istanbul ignore next
export class AppRoutingModule {
}