Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
3acc24e
Fixed gulp and package.json file, added .gitignore and tsconfig
chandermani Nov 15, 2015
6b8e7ed
Added nav bar and fixed container style
chandermani Dec 8, 2015
01cbac6
Fixed readme and package urls
chandermani Dec 14, 2015
604166c
Bumped Angular package.
chandermani Dec 15, 2015
0bec2c5
Upgraded to angular beta.
chandermani Dec 17, 2015
4383096
Added history tracking capabilities
chandermani Dec 22, 2015
f395163
Refactor to move the history tracker as global dependency.
chandermani Dec 22, 2015
8f86f73
Added local-storage support for history save.
chandermani Dec 23, 2015
58b5d7d
Moved the html template to app.ts
chandermani Dec 23, 2015
be16841
Moved the index template to app component. Index now only has trainer…
chandermani Dec 23, 2015
51a55a6
Initial commit to Checkpoint 4.1
kevinhennessy Dec 30, 2015
2c531e6
Removed audio implementation from checkpoint3.2
chandermani Jan 1, 2016
ec0f1db
Merge branch 'checkpoint3.2' into checkpoint3.3
chandermani Jan 1, 2016
2fb5c6a
Added workout history page.
chandermani Jan 1, 2016
f61a379
Change App name to Personal Trainer; fix component name for top-nav
kevinhennessy Jan 2, 2016
c06c432
Added workout history page.
chandermani Jan 1, 2016
fc8fd11
Fixed workout-audio. Fixed circular reference issue between parent an…
chandermani Jan 3, 2016
4fbead1
Remove @ViewChild from workout-runner
chandermani Jan 3, 2016
8a1b5e0
Implement Child Routing in Workout Builder
kevinhennessy Jan 5, 2016
0842c1f
Delete workout-builder.tpl.html
kevinhennessy Jan 5, 2016
ca4112d
Removed the deprecated next, replaced it with emit
chandermani Jan 7, 2016
310e635
Refactored audio implementation to use inter component communication …
chandermani Jan 7, 2016
067de7a
Made types for event for easy understanding.
chandermani Jan 9, 2016
edcda39
Made types for event for easy understanding.
chandermani Jan 9, 2016
dc501f7
Added filters for search and order by,
chandermani Jan 11, 2016
1d6ad99
Change TopNav to SubNav -- other minor fixes
kevinhennessy Jan 16, 2016
98f202b
Delete duplicate file reference
kevinhennessy Jan 16, 2016
7d375b0
Fixed search pipe and commented the filtering html.
chandermani Jan 11, 2016
7ebb8ad
Fixes to bring checkpoint3.2 in sync with book code.
chandermani Jan 19, 2016
023620a
Merge branch 'checkpoint3.2' into checkpoint3.3
chandermani Jan 19, 2016
c44badd
Fixed checkpoint3.2 commented code to make pipes work.
chandermani Jan 19, 2016
85cefaf
Remove stray directive,
chandermani Jan 19, 2016
ff9fab1
Merge branch 'checkpoint3.3' of https://github.com/chandermani/angula…
chandermani Jan 19, 2016
cba8818
Merge branch 'checkpoint3.3' into checkpoint4.1
chandermani Jan 21, 2016
2ae59b0
Merge branch 'checkpoint3.3' into checkpoint4.2
chandermani Feb 1, 2016
d5f1d4c
local commit following merge with remote branch
kevinhennessy Feb 5, 2016
486465b
Merge branch 'checkpoint3.2' of https://github.com/chandermani/angula…
kevinhennessy Apr 16, 2016
aee7e4b
Upgrade to Angular 2.0.0-beta14
kevinhennessy Apr 16, 2016
d3aaa05
Upgrade to Angular 2.0.0-beta14
kevinhennessy Apr 16, 2016
36797d7
Upgraded to Angular beta 15
chandermani Apr 17, 2016
8f3f719
Fixed SPA HTML5 mode. C'hanged gulp to use gulp-connect.
chandermani Apr 17, 2016
d7204c8
Upgraded to Angular 2.0.0 beta 15
chandermani Apr 17, 2016
3f272ce
Fixed SPA HTML5 mode. C'hanged gulp to use gulp-connect.
chandermani Apr 17, 2016
217c50c
Converted history to a dialog.
chandermani Apr 24, 2016
2d8f965
Converted video player to dialog too.
chandermani Apr 24, 2016
0f07627
Upgraded to Angular 2.0.0 beta 15
chandermani Apr 17, 2016
e3c88c1
Fixed SPA HTML5 mode. C'hanged gulp to use gulp-connect.
chandermani Apr 17, 2016
d589c7f
Converted history to a dialog.
chandermani Apr 24, 2016
b14bdfc
Converted video player to dialog too.
chandermani Apr 24, 2016
11c9b52
Upgraded to Angular 2.0.0 beta 15
chandermani Apr 17, 2016
cd9bc4d
Fixed SPA HTML5 mode. C'hanged gulp to use gulp-connect.
chandermani Apr 17, 2016
d247158
Converted history to a dialog.
chandermani Apr 24, 2016
8b61f0f
Converted video player to dialog too.
chandermani Apr 24, 2016
ec8b3f7
Reverted the history dialog back to full page
chandermani Apr 27, 2016
3150bac
Hiding the history link for workout page.
chandermani Apr 27, 2016
b98ef0f
Fixed some extra code.
chandermani Apr 29, 2016
939a40f
Fixed pipes to make search pure and return new array when no search term
chandermani May 1, 2016
64a5d20
Custom Validation; Fixes to exercise count validation and other valid…
kevinhennessy May 2, 2016
cf52918
Reverted the history dialog back to full page
chandermani Apr 27, 2016
8779934
Hiding the history link for workout page.
chandermani Apr 27, 2016
b5d62e4
Fixed some extra code.
chandermani Apr 29, 2016
49b977a
Fixed pipes to make search pure and return new array when no search term
chandermani May 1, 2016
10b6e64
Reverted the history dialog back to full page
chandermani Apr 27, 2016
b1f6b9c
Hiding the history link for workout page.
chandermani Apr 27, 2016
e721bee
Fixed some extra code.
chandermani Apr 29, 2016
b04477c
Fixed pipes to make search pure and return new array when no search term
chandermani May 1, 2016
dd79da7
Chandermani latest updates from Chapter 3
kevinhennessy May 2, 2016
82963a9
Custom Validation; Fixes to exercise count validation and other valid…
kevinhennessy May 2, 2016
6eec055
Upgraded to Angular 2 rc1
chandermani May 9, 2016
7db5711
Upgraded to Angular 2 rc1, and upgraded router and angular2-modal and…
chandermani May 15, 2016
22f707a
Update to RC1
kevinhennessy May 16, 2016
a88af7a
Merge branch 'base' of https://github.com/chandermani/angular2byexamp…
kevinhennessy May 16, 2016
862b428
Refactoring according to style guide.
chandermani May 10, 2016
578018d
Merge branch 'checkpoint3.3' into checkpoint4.1
chandermani May 17, 2016
24f537c
Removed reference for deprecated router
chandermani May 17, 2016
cdfa529
Removed reference for deprecated router
chandermani May 17, 2016
33c63ea
Removed reference for deprecated router
chandermani May 17, 2016
510e8d0
Update to RC1 - simplify module loading config
kevinhennessy May 22, 2016
549f2bf
Merge remote-tracking branch 'origin/base' into base
kevinhennessy May 22, 2016
45b2b2a
Removed extra input import from my-audio.directive
chandermani May 23, 2016
2c68336
Update folder structure per Style Guide
kevinhennessy May 25, 2016
903e5b9
Merge branch 'checkpoint4.1' of https://github.com/chandermani/angula…
kevinhennessy May 27, 2016
f6df100
Merge branch 'checkpoint4.1' of https://github.com/chandermani/angula…
kevinhennessy May 27, 2016
1620c0b
Update header.component.ts
kevinhennessy May 28, 2016
0022a4d
Update sub-nav.component.html
kevinhennessy May 28, 2016
1e92986
Update sub-nav.component.ts
kevinhennessy May 28, 2016
ac8db57
Update sub-nav.component.ts
kevinhennessy May 28, 2016
fee28fa
Update sub-nav.component.ts
kevinhennessy May 28, 2016
2f0f28a
Upgraded to angular rc2
chandermani Jun 18, 2016
81e5a60
Fixed checkpoint2.3 video-player, to sanitize video content using Dom…
chandermani Jun 22, 2016
1c8aa6a
Upgraded to angular rc2
chandermani Jun 18, 2016
a8d4099
Upgraded to angular rc4
chandermani Jul 1, 2016
1d044f6
Upgraded to angular rc4
chandermani Jul 1, 2016
00b1017
Merge branch 'checkpoint3.3' into checkpoint4.1
chandermani Jul 2, 2016
b44076f
Fix missing comma in package.json
kevinhennessy Jul 5, 2016
93aedf4
Merge checkpoint4.1 into checkpoint4.2
kevinhennessy Jul 5, 2016
1f80257
Merge checkpoint4.1 into checkpoint4.2
kevinhennessy Jul 5, 2016
2cbcf37
Fixed minor code issue in checkpoint2.3. Merged with 2.4
chandermani Jul 8, 2016
aeca4a1
Fixed minor code issue in checkpoint2.3. Merged with 2.4
chandermani Jul 8, 2016
27c7e30
Fixed minor code issue in checkpoint2.3. Merged with 2.4
chandermani Jul 8, 2016
89ba3f7
Updated systemjs to support bundled umd files
chandermani Jul 9, 2016
1a0fa32
Updated systemjs to support bundled umd files
chandermani Jul 9, 2016
8b414d6
Updated systemjs to support bundled umd files
chandermani Jul 9, 2016
87f689f
Merge remote-tracking branch 'remotes/origin/checkpoint4.1' into chec…
kevinhennessy Jul 14, 2016
dd74345
Updated ES6 typing definition to use core-js and removed extra video-…
chandermani Aug 2, 2016
19edde8
Updated ES6 typing definition to use core-js
chandermani Jul 30, 2016
a76d7ff
Updated ES6 typing definition to use core-js
chandermani Jul 30, 2016
918258c
remove video-dailog.ts
kevinhennessy Aug 9, 2016
c91c867
Merge remote-tracking branch 'remotes/origin/checkpoint3.3' into chec…
kevinhennessy Aug 9, 2016
e244414
Merge branch 'checkpoint4.1' into checkpoint4.2
kevinhennessy Aug 9, 2016
2b6b7e9
remove unused index files
kevinhennessy Aug 9, 2016
2c819ec
remove unused index files
kevinhennessy Aug 9, 2016
82012c5
Merge branch 'checkpoint4.2' of https://github.com/chandermani/angula…
kevinhennessy Aug 9, 2016
6df9cf5
Merge remote-tracking branch 'remotes/origin/checkpoint4.1' into chec…
kevinhennessy Aug 9, 2016
e861f18
Update to RC4
kevinhennessy Aug 24, 2016
22604e1
Merge branch 'base' of https://github.com/chandermani/angular2byexamp…
kevinhennessy Aug 24, 2016
30082b9
Update GuessTheNumber to RC4
kevinhennessy Aug 24, 2016
486ca8d
Merge branch 'checkpoint1.1' into checkpoint4.1
kevinhennessy Aug 24, 2016
6a71450
Update GuessTheNumber to RC4
kevinhennessy Aug 24, 2016
f17f976
Update GuessTheNumber to RC4
kevinhennessy Aug 24, 2016
56c773c
Fixed router with 3.0.0 beta.2
chandermani Aug 25, 2016
ca41ae2
Fixed history link hiding when route is workout.
chandermani Aug 25, 2016
f04f68f
Update README.md
chandermani Aug 28, 2016
c4db493
Update README.md
chandermani Aug 28, 2016
9002700
Update README.md
chandermani Aug 28, 2016
06c46c2
Update README.md
chandermani Aug 28, 2016
737eb33
Update README.md
chandermani Aug 28, 2016
83cbaa4
Update README.md
chandermani Aug 28, 2016
830b50c
Merge branch 'checkpoint4.1' of https://github.com/chandermani/angula…
kevinhennessy Aug 28, 2016
7a35390
Fixed router with 3.0.0 beta.2
chandermani Aug 31, 2016
2bc8abd
Fixed router with 3.0.0 beta.2
chandermani Aug 31, 2016
5eb432a
Upgrade GTN to final release
kevinhennessy Sep 16, 2016
f6dbf6f
Upgrade GTN to final release
kevinhennessy Sep 16, 2016
899a994
Upgrade GTN to final release
kevinhennessy Sep 16, 2016
2faf549
Replace npmcdn.com with unpkg.com
kevinhennessy Sep 19, 2016
f509aca
Replace npmcdn.com with unpkg.com
kevinhennessy Sep 19, 2016
d7accbc
Replace npmcdn.com with unpkg.com
kevinhennessy Sep 19, 2016
a362552
Upgraded to Angular 2.0.0. Added module for workout-runner
chandermani Sep 20, 2016
4700bd8
Upgraded to Angular 2.0.0. Added module for workout-builder.
kevinhennessy Sep 22, 2016
67b1353
Upgraded to Angular 2.0.0. Added module for workout-builder.
kevinhennessy Sep 22, 2016
7577a8a
Upgraded to Angular 2.0.0. Added child routes for workout-builder.
kevinhennessy Sep 23, 2016
7b4e449
Upgraded to Angular 2.0.0. Added child routes for workout-builder.
kevinhennessy Sep 23, 2016
b97f8be
Change import in Workout Builder Module from BrowserModule to CommonM…
kevinhennessy Oct 1, 2016
9144313
Change import in Workout Builder Module from BrowserModule to CommonM…
kevinhennessy Oct 1, 2016
3385cb6
Merge branch 'checkpoint3.3' into checkpoint4.1
chandermani Oct 4, 2016
0922817
Merge branch 'checkpoint3.3' into checkpoint4.1
chandermani Oct 4, 2016
070aaba
Merge Checkpoint 4.1 into Checkpoint 4.2
kevinhennessy Oct 4, 2016
b530618
Merge branch 'checkpoint4.2' of https://github.com/chandermani/angula…
kevinhennessy Oct 4, 2016
5321b30
Remove builder route from app.routes.ts
kevinhennessy Oct 4, 2016
7e42242
Removed typings tool. Typings will come as npm package. Upgraded gulp…
chandermani Mar 9, 2017
d2f70bf
Updated readme describing the new way to instal typings
chandermani Mar 15, 2017
bbddc0f
Removed extra typing install instructions.
chandermani Mar 15, 2017
5114329
lock dependency on types core js to 0 9 36
kevinhennessy Mar 27, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# angular2byexample
Source code repository for the book "Angular2 by Example"
# Angular2 By Example

[![Angular2 By Example Front Cover](https://d1ldz4te4covpm.cloudfront.net/sites/default/files/imagecache/ppv4_main_book_cover/B05079_MockupCover_Normal.jpg)](https://www.packtpub.com/web-development/angular-2-example)

Source code repository for the book [Angular2 by Example](https://www.packtpub.com/web-development/angular-2-example)

**Releasing soon!!**

To setup code for Guess The Number see the README.md in **guessthenumber** folder.

To setup code for Personal Trainer see the README.md in **trainer** folder.

## Note

The **master** branch contains the final outcome for both the samples we build throughout the book.

Chapter progress is tracked using individual branches. Each **chapter has checkpoints** and each checkpoint code is **available on a seperate branch**.

For example, branches *base*, *checkpoint2.1*, *checkpoint2.2*, *checkpoint2.3* and *checkpoint2.4* contain code checkpoints for **Chapter 2**.
48 changes: 0 additions & 48 deletions guessthenumber/app.ts

This file was deleted.

12 changes: 12 additions & 0 deletions guessthenumber/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { GuessTheNumberComponent } from './guess-the-number.component';

@NgModule({
imports: [ BrowserModule ],
declarations: [ GuessTheNumberComponent ],
bootstrap: [ GuessTheNumberComponent ]
})

export class AppModule { }
43 changes: 43 additions & 0 deletions guessthenumber/app/guess-the-number.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { Component }from '@angular/core';

@Component({
selector: 'my-app',
template: `
<div class="container">
<h2>Guess the Number !</h2>
<p class="well lead">Guess the computer generated random number between 1 and 1000.</p>
<label>Your Guess: </label>
<input type="number" [value]="guess" (input)="guess = $event.target.value" />
<button (click)="verifyGuess()" class="btn btn-primary btn-sm">Verify</button>
<button (click)="initializeGame()" class="btn btn-warning btn-sm">Restart</button>
<div>
<p *ngIf="deviation<0" class="alert alert-warning">Your guess is higher.</p>
<p *ngIf="deviation>0" class="alert alert-warning">Your guess is lower.</p>
<p *ngIf="deviation===0" class="alert alert-success">Yes! That's it.</p>
</div>
<p class="text-info">No of guesses :
<span class="badge">{{noOfTries}}</span>
</p>
</div>
`
})
export class GuessTheNumberComponent {
deviation: number;
noOfTries: number;
original: number;
guess: number;

constructor() {
this.initializeGame();
}
initializeGame() {
this.noOfTries = 0;
this.original = Math.floor((Math.random() * 1000) + 1);
this.guess = null;
this.deviation = null;
}
verifyGuess() {
this.deviation = this.original - this.guess;
this.noOfTries = this.noOfTries + 1;
}
}
6 changes: 6 additions & 0 deletions guessthenumber/app/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app.module';

const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);
40 changes: 16 additions & 24 deletions guessthenumber/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
<!DOCTYPE html>
<html>

<head>
<title>Guess the Number!</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.26/system.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/typescript/1.8.10/typescript.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.15/angular2.dev.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.15/angular2-polyfills.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.15/Rx.js"></script>
<script>
System.config({
transpiler: 'typescript',
typescriptOptions: {
emitDecoratorMetadata: true
}
});
System.import('./app.ts');
</script>
</head>

<body>
<my-app>Loading...</my-app>
</body>

<head>
<title>Guess the Number!</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="https://unpkg.com/core-js/client/shim.min.js"></script>
<script src="https://unpkg.com/[email protected]"></script>
<script src="https://unpkg.com/[email protected]?main=browser"></script>
<script src="https://unpkg.com/[email protected]/lib/typescript.js"></script>
<script src="https://unpkg.com/[email protected]/dist/system.js"></script>
<script src="systemjs.config.js"></script>
<script>
System.import('app').catch(function(err){ console.error(err); });
</script>
</head>
<body>
<my-app>Loading...</my-app>
</body>
</html>
24 changes: 24 additions & 0 deletions guessthenumber/systemjs.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
System.config({
map : {
'app': 'app',
'rxjs': 'https://unpkg.com/[email protected]',
'@angular/common': 'https://unpkg.com/@angular/[email protected]',
'@angular/compiler': 'https://unpkg.com/@angular/[email protected]',
'@angular/core': 'https://unpkg.com/@angular/[email protected]',
'@angular/platform-browser': 'https://unpkg.com/@angular/[email protected]',
'@angular/platform-browser-dynamic': 'https://unpkg.com/@angular/[email protected]'
},
packages:{
'app': { main: 'main.ts', defaultExtension: 'ts' },
'@angular/common': { main: 'bundles/common.umd.js', defaultExtension: 'js' },
'@angular/compiler': { main: 'bundles/compiler.umd.js', defaultExtension: 'js' },
'@angular/core': { main: 'bundles/core.umd.js', defaultExtension: 'js' },
'@angular/platform-browser': { main: 'bundles/platform-browser.umd.js', defaultExtension: 'js' },
'@angular/platform-browser-dynamic': { main: 'bundles/platform-browser-dynamic.umd.js', defaultExtension: 'js' },
},
// DEMO ONLY! REAL CODE SHOULD NOT TRANSPILE IN THE BROWSER
transpiler: 'typescript',
typescriptOptions: {
emitDecoratorMetadata: true
}
});
1 change: 1 addition & 0 deletions trainer/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
typings/**
7 changes: 7 additions & 0 deletions trainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ Clone this repo and execute in your favourite shell:
After completing installation type in your favourite shell:

* `gulp play` to start the app in a new browser window. App files are observed and will be re-transpiled on each change.

> ~~If you see a bunch of **TypeScript** compilation errors while running `gulp play`, the required **typings** did not get installed. While `npm install` should also install the typings, at times this does not happen.
> If the typing installation throws error try to upgrade the typing global installation with command `npm install typings -g` and then run the command `npm run typings install` again.~~

> The old approach of using the `typings` tool to install typings has been abandoned in favour of **npm** based typing supported by new versions of **TypeScript** compiler. Take latest of the code and upgrade to latest version of TypeScript compiler. `npm install` should now install all typings.

> **Note**: The book content still show use of `typings`, you can disregard it.
77 changes: 44 additions & 33 deletions trainer/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,56 @@
var gulp = require('gulp');
var connect = require('gulp-connect');
var PATHS = {
src: 'src/**/*.ts'
src: 'src/**/*.ts',
html: 'src/**/*.html',
css: 'src/**/*.css'
};

gulp.task('clean', function (done) {
var del = require('del');
del(['dist'], done);
gulp.task('clean', function(done) {
var del = require('del');
del(['dist'], done);
});

gulp.task('ts2js', function () {
var typescript = require('gulp-typescript');
var sourcemaps = require('gulp-sourcemaps');

var tsResult = gulp.src(PATHS.src)
.pipe(sourcemaps.init())
.pipe(typescript({
noImplicitAny: true,
module: 'system',
target: 'ES5',
moduleResolution: 'node',
emitDecoratorMetadata: true,
experimentalDecorators: true
}));

return tsResult.js
.pipe(sourcemaps.write())
.pipe(gulp.dest('dist'));
gulp.task('ts2js', function() {
var typescript = require('gulp-typescript');
var sourcemaps = require('gulp-sourcemaps');

var tsResult = gulp.src(PATHS.src)
.pipe(sourcemaps.init())
.pipe(typescript({
noImplicitAny: true,
module: 'system',
target: 'ES5',
moduleResolution: 'node',
emitDecoratorMetadata: true,
experimentalDecorators: true
}));

return tsResult.js
.pipe(sourcemaps.write())
.pipe(gulp.dest('dist'))
.pipe(connect.reload());
});

gulp.task('play', ['ts2js'], function () {
var http = require('http');
var connect = require('connect');
var serveStatic = require('serve-static');
var open = require('open');
gulp.task('play', ['ts2js'], function() {
var http = require('http');
var open = require('open');
var watch = require('gulp-watch');

var port = 9000, app;

gulp.watch(PATHS.src, ['ts2js']);

app = connect().use(serveStatic(__dirname));
http.createServer(app).listen(port, function () {
open('http://localhost:' + port);
});
var port = 9000,
app;

connect.server({
root: __dirname,
port: port,
livereload: true,
fallback: 'index.html'
});
open('http://localhost:' + port + '/index.html');

gulp.watch(PATHS.src, ['ts2js']);
watch(PATHS.html).pipe(connect.reload());
watch(PATHS.css).pipe(connect.reload());
});
35 changes: 12 additions & 23 deletions trainer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,26 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
<link href="//fonts.googleapis.com/css?family=Roboto+Slab:100,300,400,700" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="static/css/app.css" />
<link rel="stylesheet" href="/static/css/app.css" />
<base href="/">
</head>

<body>
<div class="navbar navbar-default navbar-fixed-top top-navbar">
<div class="container app-container">
<div class="navbar-header">
<h1>7 Minute Workout</h1>
</div>
</div>
</div>
<div class="container body-content app-container">
<trainer-app>Loading...</trainer-app>
</div>
<trainer-app>Loading...</trainer-app>
</body>

<!-- ES6-related imports -->
<script src="/node_modules/systemjs/dist/system.js"></script>
<!-- Libraries imports -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>

<!-- Configure SystemJS -->
<script src="systemjs.config.js"></script>

<script>
//configure system loader
System.config({defaultJSExtensions: true});
</script>
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="/node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="/node_modules/angular2/bundles/router.dev.js"></script>
<script>
//bootstrap the Angular2 application
System.import('dist/bootstrap').catch(console.log.bind(console));
System.import('app').catch(console.log.bind(console));
</script>

<script src="http://localhost:35729/livereload.js"></script>
</html>
Loading