import { Routes, RouterModule } from '@angular/router';

import { HomepageComponent } from './homepage/homepage.component';
import { LoginComponent } from './profile/login/login.component';
import { SignUpComponent } from './profile/sign-up/sign-up.component';
import { UserProfileComponent } from './profile/user-profile/user-profile.component';
import { SnippetEditorComponent } from './snippets/snippet-editor/snippet-editor.component';
import { SnippetViewerComponent } from './snippets/snippet-viewer/snippet-viewer.component';
import { PublicSnippetsComponent } from './snippets/public-snippets/public-snippets.component';

const APP_ROUTES: Routes = [
    { path: '', component: HomepageComponent },
    { path: 'login', component: LoginComponent },
    { path: 'sign-up', component: SignUpComponent },
    { path: 'profile', component: UserProfileComponent },
    { path: 'snippet/editor', component: SnippetEditorComponent },
    { path: 'snippets', component: PublicSnippetsComponent },
    { path: 'snippet/:id', component: SnippetViewerComponent }
];

export const ROUTING = RouterModule.forRoot(APP_ROUTES);

import { Routes, RouterModule } from '@angular/router';

import { HomepageComponent } from './homepage/homepage.component';
import { LoginComponent } from './profile/login/login.component';
import { SignUpComponent } from './profile/sign-up/sign-up.component';
import { UserProfileComponent } from './profile/user-profile/user-profile.component';
import { SnippetEditorComponent } from './snippets/snippet-editor/snippet-editor.component';
import { SnippetViewerComponent } from './snippets/snippet-viewer/snippet-viewer.component';

const APP_ROUTES: Routes = [
    { path: '', component: HomepageComponent },
    { path: 'login', component: LoginComponent },
    { path: 'sign-up', component: SignUpComponent },
    { path: 'profile', component: UserProfileComponent },
    { path: 'snippet/editor', component: SnippetEditorComponent },
    { path: 'snippet/view', component: SnippetViewerComponent }
];

export const ROUTING = RouterModule.forRoot(APP_ROUTES);

--- 
+++ 
@@ -6,6 +6,7 @@
 import { UserProfileComponent } from './profile/user-profile/user-profile.component';
 import { SnippetEditorComponent } from './snippets/snippet-editor/snippet-editor.component';
 import { SnippetViewerComponent } from './snippets/snippet-viewer/snippet-viewer.component';
+import { PublicSnippetsComponent } from './snippets/public-snippets/public-snippets.component';
 
 const APP_ROUTES: Routes = [
     { path: '', component: HomepageComponent },
@@ -13,7 +14,8 @@
     { path: 'sign-up', component: SignUpComponent },
     { path: 'profile', component: UserProfileComponent },
     { path: 'snippet/editor', component: SnippetEditorComponent },
-    { path: 'snippet/view', component: SnippetViewerComponent }
+    { path: 'snippets', component: PublicSnippetsComponent },
+    { path: 'snippet/:id', component: SnippetViewerComponent }
 ];
 
 export const ROUTING = RouterModule.forRoot(APP_ROUTES);
Add public snippets route. Add snippet by id route

