diff --git a/public/docs/_examples/cb-electron/ts/app/heroes.component.ts b/public/docs/_examples/cb-electron/ts/app/heroes.component.ts
new file mode 100644
index 0000000000..df3f26c69b
--- /dev/null
+++ b/public/docs/_examples/cb-electron/ts/app/heroes.component.ts
@@ -0,0 +1,71 @@
+// #docregion
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router-deprecated';
+
+import { Hero } from './hero';
+import { HeroService } from './hero.service';
+// #docregion hero-detail-component
+import { HeroDetailComponent } from './hero-detail.component';
+
+@Component({
+ selector: 'my-heroes',
+ templateUrl: 'app/heroes.component.html',
+ styleUrls: ['app/heroes.component.css'],
+ directives: [HeroDetailComponent]
+})
+// #enddocregion hero-detail-component
+export class HeroesComponent implements OnInit {
+ heroes: Hero[];
+ selectedHero: Hero;
+ addingHero = false;
+ error: any;
+
+ constructor(
+ private router: Router,
+ private heroService: HeroService) { }
+
+ getHeroes() {
+ this.heroService
+ .getHeroes()
+ .then(heroes => this.heroes = heroes)
+ .catch(error => this.error = error); // TODO: Display error message
+ }
+
+ // #docregion add
+ addHero() {
+ this.addingHero = true;
+ this.selectedHero = null;
+ }
+
+ close(savedHero: Hero) {
+ this.addingHero = false;
+ if (savedHero) { this.getHeroes(); }
+ }
+ // #enddocregion add
+
+ // #docregion delete
+ delete(hero: Hero, event: any) {
+ event.stopPropagation();
+ this.heroService
+ .delete(hero)
+ .then(res => {
+ this.heroes = this.heroes.filter(h => h !== hero);
+ if (this.selectedHero === hero) { this.selectedHero = null; }
+ })
+ .catch(error => this.error = error); // TODO: Display error message
+ }
+ // #enddocregion delete
+
+ ngOnInit() {
+ this.getHeroes();
+ }
+
+ onSelect(hero: Hero) {
+ this.selectedHero = hero;
+ this.addingHero = false;
+ }
+
+ gotoDetail() {
+ this.router.navigate(['HeroDetail', { id: this.selectedHero.id }]);
+ }
+}
diff --git a/public/docs/_examples/cb-electron/ts/app/in-memory-data.service.ts b/public/docs/_examples/cb-electron/ts/app/in-memory-data.service.ts
new file mode 100644
index 0000000000..791b6ae2c5
--- /dev/null
+++ b/public/docs/_examples/cb-electron/ts/app/in-memory-data.service.ts
@@ -0,0 +1,18 @@
+// #docregion
+export class InMemoryDataService {
+ createDb() {
+ let heroes = [
+ {id: 11, name: 'Mr. Nice'},
+ {id: 12, name: 'Narco'},
+ {id: 13, name: 'Bombasto'},
+ {id: 14, name: 'Celeritas'},
+ {id: 15, name: 'Magneta'},
+ {id: 16, name: 'RubberMan'},
+ {id: 17, name: 'Dynama'},
+ {id: 18, name: 'Dr IQ'},
+ {id: 19, name: 'Magma'},
+ {id: 20, name: 'Tornado'}
+ ];
+ return {heroes};
+ }
+}
diff --git a/public/docs/_examples/cb-electron/ts/app/main.ts b/public/docs/_examples/cb-electron/ts/app/main.ts
new file mode 100644
index 0000000000..958b9a8c69
--- /dev/null
+++ b/public/docs/_examples/cb-electron/ts/app/main.ts
@@ -0,0 +1,28 @@
+// #docplaster
+// #docregion final
+// Imports for loading & configuring the in-memory web api
+import { XHRBackend } from '@angular/http';
+
+import { InMemoryBackendService, SEED_DATA } from 'angular2-in-memory-web-api';
+import { InMemoryDataService } from './in-memory-data.service';
+
+// The usual bootstrapping imports
+// #docregion v1
+import { bootstrap } from '@angular/platform-browser-dynamic';
+import { HTTP_PROVIDERS } from '@angular/http';
+
+import { AppComponent } from './app.component';
+
+// #enddocregion v1, final
+/*
+// #docregion v1
+bootstrap(AppComponent, [ HTTP_PROVIDERS ]);
+// #enddocregion v1
+ */
+// #docregion final
+bootstrap(AppComponent, [
+ HTTP_PROVIDERS,
+ { provide: XHRBackend, useClass: InMemoryBackendService }, // in-mem server
+ { provide: SEED_DATA, useClass: InMemoryDataService } // in-mem server data
+]);
+// #enddocregion final
diff --git a/public/docs/_examples/cb-electron/ts/example-config.json b/public/docs/_examples/cb-electron/ts/example-config.json
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/public/docs/_examples/cb-electron/ts/index.html b/public/docs/_examples/cb-electron/ts/index.html
new file mode 100644
index 0000000000..082f913c47
--- /dev/null
+++ b/public/docs/_examples/cb-electron/ts/index.html
@@ -0,0 +1,27 @@
+
+
+
+
+ Angular 2 Tour of Heroes - Electron
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Loading...
+
+
diff --git a/public/docs/_examples/cb-electron/ts/index.js b/public/docs/_examples/cb-electron/ts/index.js
new file mode 100644
index 0000000000..7de00a7e19
--- /dev/null
+++ b/public/docs/_examples/cb-electron/ts/index.js
@@ -0,0 +1,53 @@
+// #docregion
+//This configuration is a sample from the Electron Quick Start http://electron.atom.io/docs/tutorial/quick-start/
+
+const electron = require('electron');
+// Module to control application life.
+const {app} = electron;
+// Module to create native browser window.
+const {BrowserWindow} = electron;
+
+// Keep a global reference of the window object, if you don't, the window will
+// be closed automatically when the JavaScript object is garbage collected.
+let win;
+
+function createWindow() {
+ // Create the browser window.
+ win = new BrowserWindow({width: 800, height: 600});
+
+ // and load the index.html of the app.
+ win.loadURL(`file://${__dirname}/index.html`);
+
+ // Open the DevTools.
+ win.webContents.openDevTools();
+
+ // Emitted when the window is closed.
+ win.on('closed', () => {
+ // Dereference the window object, usually you would store windows
+ // in an array if your app supports multi windows, this is the time
+ // when you should delete the corresponding element.
+ win = null;
+ });
+}
+
+// This method will be called when Electron has finished
+// initialization and is ready to create browser windows.
+// Some APIs can only be used after this event occurs.
+app.on('ready', createWindow);
+
+// Quit when all windows are closed.
+app.on('window-all-closed', () => {
+ // On macOS it is common for applications and their menu bar
+ // to stay active until the user quits explicitly with Cmd + Q
+ if (process.platform !== 'darwin') {
+ app.quit();
+ }
+});
+
+app.on('activate', () => {
+ // On macOS it's common to re-create a window in the app when the
+ // dock icon is clicked and there are no other windows open.
+ if (win === null) {
+ createWindow();
+ }
+});
diff --git a/public/docs/_examples/cb-electron/ts/sample.css b/public/docs/_examples/cb-electron/ts/sample.css
new file mode 100644
index 0000000000..042f0494f6
--- /dev/null
+++ b/public/docs/_examples/cb-electron/ts/sample.css
@@ -0,0 +1,8 @@
+button.delete-button{
+ float:right;
+ background-color: gray !important;
+ color:white;
+}
+
+
+
diff --git a/public/docs/ts/latest/cookbook/toh-electron.jade b/public/docs/ts/latest/cookbook/toh-electron.jade
new file mode 100644
index 0000000000..f8a16603c3
--- /dev/null
+++ b/public/docs/ts/latest/cookbook/toh-electron.jade
@@ -0,0 +1,97 @@
+include ../_util-fns
+
+:marked
+ JavaScript has traditionally been a website scripting language, but has become a popular language for desktop and server side development as well.
+
+ In this cookbook we show how to create cross platform dektop applications using Angular and Electron.
+
+
+:marked
+ ## Table of contents
+
+ [Electron](#electron)
+
+ [Adding Tour of Heroes](#toh)
+
+ [Running the Application](#running-application)
+
+.l-main-section
+
+:marked
+ ## Electron
+
+ Electron provides a runtime envrionment for executing JavaScript in dektop applications.
+
+ We will take our existing Tour of Heroes application and turn it into an Electron dekstop application instead of a traditional web application.
+
+ Before we can get started we have to install the Electron runtime.
+
+ The latest build of Electron can be installed by running `npm install -g electron-prebuilt`.
+
+ Installing `electron-prebuilt` with `-g` makes the installation global, but this is not a requirement.
+
+.l-main-section
+
+:marked
+ ## Adding Tour of Heroes
+
+ It may seem like an ambitious goal to convert an application like Tour of Heroes to a dektop application. The question is, can it be done without making major changes to the existing code?
+
+ Luckily the answer is yes. In fact the code can be ported to Electron nearly without any code changes at all.
+
+ We pick up where Tour of Heroes left of with the following files:
+
+.filetree
+ .file angular2-tour-of-heroes
+ .children
+ .file app
+ .children
+ .file app.component.ts
+ .file app.component.css
+ .file dashboard.component.css
+ .file dashboard.component.html
+ .file dashboard.component.ts
+ .file hero.ts
+ .file hero-detail.component.css
+ .file hero-detail.component.html
+ .file hero-detail.component.ts
+ .file hero.service.ts
+ .file heroes.component.css
+ .file heroes.component.html
+ .file heroes.component.ts
+ .file main.ts
+ .file hero-data.service.ts
+ .file node_modules ...
+ .file typings ...
+ .file index.html
+ .file package.json
+ .file styles.css
+ .file sample.css
+ .file systemjs.config.json
+ .file tsconfig.json
+ .file typings.json
+
+:marked
+ The only modification we have to make is change the `href` of the base tag to `href="."` from `href="/"`
++makeExample('cb-electron/ts/index.html', 'base', 'ts/index.html')(format=".")
+
+:marked
+ The `href` change is necessary since Electron will reference files as physical file paths instead of relative web urls.
+
+.l-main-section
+
+:marked
+ ## Running the Application
+
+ In order to run our Tour of Heroes application we have to create a simple Electron application to host our Angular code.
+
+ We have defined the Electron application in index.js and put it in the same folder as index.html.
+
++makeExample('cb-electron/ts/index.js', null, 'index.js')(format=".")
+
+:marked
+ We can now launch the Electron application by running `electron` from the command line, and pass it the path to the application as a command line argument.
+
+ If we are starting the application from the same folder as index.html we can simple start it as `electron .`
+
+
\ No newline at end of file