Skip to content

Commit 06031d5

Browse files
committed
initial notes module work
1 parent cd91d91 commit 06031d5

File tree

8 files changed

+143
-8
lines changed

8 files changed

+143
-8
lines changed

src/app/app.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<section id="title" class="center">
1616
<h1>AngularAir</h1>
1717
<h2>
18-
A <strong>live</strong> weekly video podcast covering the Angular JavaScript platform.
18+
A <strong>live</strong> weekly videocast covering the Angular JavaScript platform.
1919
</h2>
2020
<p>
2121
Brought to you with support from <a href="http://angularclass.com">AngularClass</a>
@@ -49,3 +49,4 @@ <h2>Upcoming Episodes</h2>
4949
<h2>Past Episodes</h2>
5050
<app-episode-card *ngFor="let episode of (model | async)?.pastEpisodes" [episode]="episode"></app-episode-card>
5151
</section>
52+
<router-outlet></router-outlet>

src/app/app.module.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,27 @@ import { rootReducer } from "./shared/state/reducers/root.reducer";
1313
import appState from './data.json';
1414
import { EpisodeCardComponent } from './shared/episode-card/episode-card.component';
1515
import { PersonCardComponent } from './shared/person-card/person-card.component';
16+
import {RouterModule, Routes} from "@angular/router";
17+
18+
const appRoutes: Routes = [
19+
{path: 'episode/:id', loadChildren: 'app/episode/episode.module#EpisodeModule'}
20+
];
1621

1722
@NgModule({
23+
imports: [
24+
BrowserModule,
25+
FormsModule,
26+
HttpModule,
27+
RouterModule.forRoot(appRoutes),
28+
StoreModule.provideStore(rootReducer, appState.data)
29+
],
1830
declarations: [
1931
AppComponent,
2032
LinkIconComponent,
2133
SubscribeIconComponent,
2234
EpisodeCardComponent,
2335
PersonCardComponent
2436
],
25-
imports: [
26-
BrowserModule,
27-
FormsModule,
28-
HttpModule,
29-
StoreModule.provideStore(rootReducer, appState.data)
30-
],
3137
providers: [
3238
DateService
3339
],

src/app/data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"data": {
33
"currentHostsIds": [4],
4-
"currentPanelistsIds": [6,7,8,9],
4+
"currentPanelistsIds": [7,8,9,6],
55
"episodes": [
66
{
77
"id": 96,

src/app/episode/episode.component.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import {ChangeDetectionStrategy, Component} from "@angular/core";
2+
import {NotesService} from "./notes.service";
3+
import {ActivatedRoute, Params} from "@angular/router";
4+
5+
@Component({
6+
selector: 'app-episode',
7+
template: `
8+
<pre><code>{{notes}}</code></pre>`,
9+
changeDetection: ChangeDetectionStrategy.OnPush
10+
})
11+
export class EpisodeComponent {
12+
notes: string;
13+
14+
constructor(private route: ActivatedRoute, private notesService: NotesService) {
15+
}
16+
17+
ngOnInit() {
18+
this.route.params
19+
.switchMap((params: Params) => this.notesService.getNotesByEpisodeId(+params['id']))
20+
.subscribe((notes: string) => {
21+
this.notes = notes;
22+
console.log('wee');
23+
}, error => {
24+
});
25+
}
26+
}

src/app/episode/episode.module.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import {NgModule} from "@angular/core";
2+
import {EpisodeComponent} from "./episode.component";
3+
import {NotesService} from "./notes.service";
4+
import {CommonModule} from "@angular/common";
5+
import {RouterModule, Routes} from "@angular/router";
6+
7+
const routes: Routes = [
8+
{path: '', component: EpisodeComponent}
9+
];
10+
11+
@NgModule({
12+
imports: [
13+
CommonModule,
14+
RouterModule.forChild(routes)
15+
],
16+
exports: [RouterModule],
17+
declarations: [EpisodeComponent],
18+
providers: [NotesService]
19+
})
20+
export class EpisodeModule { }

src/app/episode/notes.service.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import {Injectable} from "@angular/core";
2+
import {Http, Response} from "@angular/http";
3+
4+
@Injectable()
5+
export class NotesService {
6+
constructor(private http: Http) {}
7+
8+
getNotesByEpisodeId(id: number) {
9+
return this.http.get(`/assets/episode-notes/${id}.md`)
10+
.map((response: Response) => response.text());
11+
}
12+
}

src/app/shared/episode-card/episode-card.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
{{person.fullName}} <a href="https://twitter.com/{{person.twitterHandle}}">@{{person.twitterHandle}}</a>
1010
</span>
1111
</div>
12+
<a routerLink="/episode/{{episode.id}}">Notes</a>

src/assets/episode-notes/96.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
### Host
2+
+ [Justin Schwartzenberger](https://twitter.com/schwarty)
3+
4+
### Panelists
5+
+ [Austin McDaniel](https://twitter.com/amcdnl)
6+
+ [Mike Brocchi](https://twitter.com/Brocco)
7+
8+
### Guests
9+
+ [Michaela Lehr](https://twitter.com/FischaelaMeer)
10+
+ [Gerard Sans](https://twitter.com/gerardsans)
11+
12+
### Episode Notes
13+
+ Introductions
14+
+ Gerard Sans
15+
+ Angular Zone
16+
<https://www.meetup.com/AngularZone/>
17+
+ Michaela Lehr
18+
+ Angular 2 Comet
19+
<http://bit.ly/ng2comet>
20+
+ Curating content
21+
+ Michaela how do you go about picking content for Comet?
22+
+ Gerard how to you go about deciding on topics for meetups?
23+
+ Places for finding content
24+
+ Twitter
25+
+ Following Angular people
26+
+ Hashtags
27+
+ Using Tweetdeck
28+
+ Blog posts
29+
+ YouTube channels
30+
+ Conference recordings
31+
+ Video podcasts
32+
+ Meetups
33+
+ Newsletters
34+
+ Reddit
35+
+ Google Alerts
36+
+ Github
37+
+ Trending
38+
+ Stack Overflow
39+
+ Books
40+
+ Saving and collecting content
41+
+ Pocket
42+
+ Flipboard
43+
+ Evernote
44+
+ Google Calendar
45+
+ Wrap up
46+
47+
### Picks
48+
+ Michaela
49+
+ Talk videos from the 33rd Chaos Communication Congress – four-day hacker conference with workshops and talks on security, information technology and its effects on the society
50+
<https://www.youtube.com/playlist?list=PL_IxoDz1Nq2bHSp-T7fXC0Cw6z7mAxkjn>
51+
+ Gerard
52+
+ Papercall.io CFP management tool (meetups, conferences
53+
<http://Papercall.io>
54+
+ Mike
55+
+ ng conf talk selection committee (lots of great content to go through)
56+
+ Austin
57+
+ Flex-layout from Angular is AWESOME
58+
<https://github.com/angular/flex-layout>
59+
+ Ng2 fundamentals by Todd Motto dropping tonight! ( his words <<<< )
60+
<https://ultimateangular.com/angular-2-fundamentals>
61+
+ AngularClass Awesome-Angular2
62+
<https://github.com/AngularClass/awesome-angular2>
63+
+ Libraries.io - lets u subscribe to new releases
64+
<http://Libraries.io>
65+
+ Js weekly is my favie
66+
<http://javascriptweekly.com/>
67+
+ Justin
68+
+ Victor Savkin webinar on using WebStorm for Angular development
69+
<https://info.jetbrains.com/WebStorm-Webinar-February2017.html>

0 commit comments

Comments
 (0)