Skip to content

Commit

Permalink
feat: set up basic routing
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepinho committed Apr 23, 2017
1 parent d55444f commit a0dcf60
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
"private": true,
"repository": "https://github.com/jessepinho/trumpymctweetface.com.git",
"dependencies": {
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"@angular/common": "^4.0.3",
"@angular/compiler": "^4.0.3",
"@angular/core": "^4.0.3",
"@angular/forms": "^4.0.3",
"@angular/http": "^4.0.3",
"@angular/platform-browser": "^4.0.3",
"@angular/platform-browser-dynamic": "^4.0.3",
"@angular/router": "^4.0.3",
"@types/d3": "^4.7.0",
"core-js": "^2.4.1",
"d3": "^4.7.4",
Expand All @@ -31,7 +31,7 @@
},
"devDependencies": {
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "^4.0.0",
"@angular/compiler-cli": "^4.0.3",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<app-timeline></app-timeline>
<router-outlet></router-outlet>
19 changes: 19 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule, Routes } from '@angular/router';

import { APIHostProvider } from './helpers/api-host';
import { AppComponent } from './app.component';
Expand All @@ -11,6 +12,23 @@ import { TimelineComponent } from './timeline/timeline.component';
import { TwitterService } from './twitter.service';
import { SvgComponent } from './svg/svg.component';

const routes: Routes = [
{
path: '',
component: AppComponent,
children: [
{
path: '',
component: TimelineComponent,
},
{
path: 'tweet/:id',
component: TimelineComponent,
},
],
},
];

@NgModule({
declarations: [
AppComponent,
Expand All @@ -23,6 +41,7 @@ import { SvgComponent } from './svg/svg.component';
BrowserModule,
FormsModule,
HttpModule,
RouterModule.forRoot(routes, { useHash: true }),
],
providers: [
APIHostProvider,
Expand Down

0 comments on commit a0dcf60

Please sign in to comment.