Skip to content

Commit e91a3fa

Browse files
committed
Updated to use SystemJS 0.19.0, fixed typings to use the one Angular gives us. The one in def typed was giving TS errors. Pushed typings up
1 parent 055f2ef commit e91a3fa

15 files changed

+35
-32
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
typings
1+
#typings
22
src/**/*.js
33
*.map
44
node_modules

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
- Add redirectTo and/or otherwise routes
1616
- Replace mocks with http when ready
17-
- Update file names with dots when SystemJS 0.19 lands
17+
- /typings folder needs to be moved manually to the /src/typings folder
18+
- paths in the typings must be fixed too
1819

1920

2021
## From Scratch

package.json

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
{
2-
"name": "angular2-tour-of-heroes",
3-
"version": "0.0.1",
4-
"scripts": {
5-
"postinstall": "npm run tsd",
6-
"tsd": "tsd reinstall -ro --config src/tsd.json",
7-
"tsc": "tsc -p src -w",
8-
"start": "live-server --open=src"
9-
},
10-
"dependencies": {
11-
"angular2": "2.0.0-alpha.37",
12-
"systemjs": "0.18.17",
13-
"traceur": "0.0.91"
14-
}
15-
}
2+
"name": "angular2-tour-of-heroes",
3+
"version": "0.0.1",
4+
"scripts": {
5+
"tsd": "tsd reinstall -ro --config src/tsd.json",
6+
"tsc": "tsc -p src -w",
7+
"start": "live-server --open=src"
8+
},
9+
"dependencies": {
10+
"angular2": "2.0.0-alpha.37",
11+
"systemjs": "0.19.0",
12+
"traceur": "0.0.91"
13+
}
14+
}

src/app/app-component.ts src/app/app.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {View, Component} from 'angular2/angular2';
22
import {RouteConfig} from 'angular2/router';
3-
import {Routes, APP_ROUTES} from './route-config';
4-
import {HERO_DIRECTIVES} from './hero-directives';
3+
import {Routes, APP_ROUTES} from './route.config';
4+
import {HERO_DIRECTIVES} from './hero.constants';
55

66
@Component({ selector: 'my-app' })
77
@View({

src/app/bootstrap.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {bootstrap} from 'angular2/angular2';
22
import {ROUTER_BINDINGS} from 'angular2/router';
3-
import {HeroService} from './hero-service';
4-
import {AppComponent} from './app-component';
3+
import {HeroService} from './hero.service';
4+
import {AppComponent} from './app.component';
55

66
bootstrap(AppComponent, [ROUTER_BINDINGS, HeroService]);
File renamed without changes.
File renamed without changes.

src/app/hero-detail-component.ts src/app/hero-detail.component.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import {Component, View} from 'angular2/angular2';
22
import {RouteParams, Router} from 'angular2/router';
33
import {Hero} from './hero';
4-
import {HeroService} from './hero-service';
5-
import {HERO_DIRECTIVES} from './hero-directives';
6-
import { Routes } from './route-config';
4+
import {HeroService} from './hero.service';
5+
import {HERO_DIRECTIVES} from './hero.constants';
6+
import { Routes } from './route.config';
77

88
@Component({selector: 'my-hero-detail'})
99
@View({
10-
templateUrl: 'app/hero-detail-component.html',
10+
templateUrl: 'app/hero-detail.component.html',
1111
directives: [HERO_DIRECTIVES]
1212
})
1313
export class HeroDetailComponent {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/app/heroes-component.ts src/app/heroes.component.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import {Component, View} from 'angular2/angular2';
22
import {Router} from 'angular2/router';
3-
import {HeroService} from './hero-service';
3+
import {HeroService} from './hero.service';
44
import {Hero} from './hero';
5-
import {Routes} from './route-config';
6-
import {HERO_DIRECTIVES} from './hero-directives';
5+
import {Routes} from './route.config';
6+
import {HERO_DIRECTIVES} from './hero.constants';
77

88
@Component({ selector: 'my-heroes' })
99
@View({
10-
templateUrl: 'app/heroes-component.html',
10+
templateUrl: 'app/heroes.component.html',
1111
directives: [HERO_DIRECTIVES],
12-
styleUrls: ['app/heroes-component.css']
12+
styleUrls: ['app/heroes.component.css']
1313
})
1414
export class HeroesComponent {
1515
private _heroes: Hero[];

src/app/route-config.ts src/app/route.config.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {HeroesComponent} from './heroes-component';
2-
import {HeroDetailComponent} from './hero-detail-component';
3-
import {DashboardComponent} from './dashboard-component';
1+
import {HeroesComponent} from './heroes.component';
2+
import {HeroDetailComponent} from './hero-detail.component';
3+
import {DashboardComponent} from './dashboard.component';
44

55
export var Routes = {
66
dashboard: {

src/typings/tsd.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/// <reference path="../../node_modules/angular2/bundles/typings/angular2/angular2.d.ts" />
2+
/// <reference path="../../node_modules/angular2/bundles/typings/angular2/http.d.ts" />
3+
/// <reference path="../../node_modules/angular2/bundles/typings/angular2/router.d.ts" />

0 commit comments

Comments
 (0)