(type: {new(...args:any[]): any }) : any[]{
if (type === Hero) {
// TODO get from the database and return as a promise
return [
- new Hero('Windstorm', 'Weather mastery'),
- new Hero('Mr. Nice', 'Killing them with kindness'),
+ new Hero('Windstorm', 'Weather mastery'),
+ new Hero('Mr. Nice', 'Killing them with kindness'),
new Hero('Magneta', 'Manipulates metalic objects')];
}
let err = new Error('Cannot get object of this type');
diff --git a/public/docs/_examples/architecture/ts/app/boot.ts b/public/docs/_examples/architecture/ts/app/boot.ts
new file mode 100644
index 0000000000..174b1289f2
--- /dev/null
+++ b/public/docs/_examples/architecture/ts/app/boot.ts
@@ -0,0 +1,13 @@
+import {bootstrap} from 'angular2/platform/browser';
+// #docregion import
+import {AppComponent} from './app.component';
+// #enddocregion import
+import {HeroService} from './hero.service';
+import {BackendService} from './backend.service';
+import {Logger} from './logger.service';
+
+// #docregion bootstrap
+bootstrap(AppComponent, [
+ BackendService, HeroService, Logger
+]);
+// #enddocregion bootstrap
diff --git a/public/docs/_examples/architecture/ts/app/hero-detail.component.html b/public/docs/_examples/architecture/ts/app/hero-detail.component.html
new file mode 100644
index 0000000000..baa3e8d9f9
--- /dev/null
+++ b/public/docs/_examples/architecture/ts/app/hero-detail.component.html
@@ -0,0 +1,9 @@
+
+{{hero.name}} Detail
+Id: {{hero.id}}
+Name:
+
+
+
+
+Power:
\ No newline at end of file
diff --git a/public/docs/_examples/intro/ts/src/app/hero-detail.component.ts b/public/docs/_examples/architecture/ts/app/hero-detail.component.ts
similarity index 80%
rename from public/docs/_examples/intro/ts/src/app/hero-detail.component.ts
rename to public/docs/_examples/architecture/ts/app/hero-detail.component.ts
index 78c94af9a1..d8c7bed1a8 100644
--- a/public/docs/_examples/intro/ts/src/app/hero-detail.component.ts
+++ b/public/docs/_examples/architecture/ts/app/hero-detail.component.ts
@@ -1,4 +1,4 @@
-import {Component, Input} from 'angular2/angular2';
+import {Component, Input} from 'angular2/core';
import {Hero} from './hero';
@Component({
diff --git a/public/docs/_examples/architecture/ts/app/hero-list.component.1.html b/public/docs/_examples/architecture/ts/app/hero-list.component.1.html
new file mode 100644
index 0000000000..55581cd645
--- /dev/null
+++ b/public/docs/_examples/architecture/ts/app/hero-list.component.1.html
@@ -0,0 +1,12 @@
+
+{{hero.name}}
+
+
+
+
+
+
+
+
+
+
diff --git a/public/docs/_examples/architecture/ts/app/hero-list.component.html b/public/docs/_examples/architecture/ts/app/hero-list.component.html
new file mode 100644
index 0000000000..a3de7f2950
--- /dev/null
+++ b/public/docs/_examples/architecture/ts/app/hero-list.component.html
@@ -0,0 +1,9 @@
+
+Hero List
+
+Pick a hero from the list
+
+ {{hero.name}}
+
+
+
diff --git a/public/docs/_examples/intro/ts/src/app/hero-list.component.ts b/public/docs/_examples/architecture/ts/app/hero-list.component.ts
similarity index 87%
rename from public/docs/_examples/intro/ts/src/app/hero-list.component.ts
rename to public/docs/_examples/architecture/ts/app/hero-list.component.ts
index b583d4f390..e001eb0294 100644
--- a/public/docs/_examples/intro/ts/src/app/hero-list.component.ts
+++ b/public/docs/_examples/architecture/ts/app/hero-list.component.ts
@@ -1,6 +1,6 @@
// #docplaster
-import {Component} from 'angular2/angular2';
+import {Component} from 'angular2/core';
import {Hero} from './hero';
import {HeroDetailComponent} from './hero-detail.component';
import {HeroService} from './hero.service'
@@ -12,7 +12,7 @@ import {HeroService} from './hero.service'
selector: 'hero-list',
templateUrl: 'app/hero-list.component.html',
directives: [HeroDetailComponent],
-// #docregion providers
+// #docregion providers
providers: [HeroService]
})
// #enddocregion providers
@@ -25,7 +25,7 @@ export class HeroesComponent { ... }
// #docregion class
export class HeroListComponent {
// #docregion ctor
- constructor(service: HeroService) {
+ constructor(service: HeroService) {
this.heroes = service.getHeroes();
}
// #enddocregion ctor
diff --git a/public/docs/_examples/intro/ts/src/app/hero.service.ts b/public/docs/_examples/architecture/ts/app/hero.service.ts
similarity index 90%
rename from public/docs/_examples/intro/ts/src/app/hero.service.ts
rename to public/docs/_examples/architecture/ts/app/hero.service.ts
index 4833be8a9b..2abc71dca0 100644
--- a/public/docs/_examples/intro/ts/src/app/hero.service.ts
+++ b/public/docs/_examples/architecture/ts/app/hero.service.ts
@@ -1,4 +1,4 @@
-import {Injectable} from 'angular2/angular2';
+import {Injectable} from 'angular2/core';
import {Hero} from './hero';
import {BackendService} from './backend.service';
import {Logger} from './logger.service';
@@ -7,7 +7,7 @@ import {Logger} from './logger.service';
@Injectable()
export class HeroService {
constructor(private _backend: BackendService, private _logger:Logger){}
-
+
getHeroes() {
// TODO return as a promise
let heroes = this._backend.getAll(Hero);
diff --git a/public/docs/_examples/intro/ts/src/app/hero.ts b/public/docs/_examples/architecture/ts/app/hero.ts
similarity index 100%
rename from public/docs/_examples/intro/ts/src/app/hero.ts
rename to public/docs/_examples/architecture/ts/app/hero.ts
diff --git a/public/docs/_examples/intro/ts/src/app/logger.service.ts b/public/docs/_examples/architecture/ts/app/logger.service.ts
similarity index 77%
rename from public/docs/_examples/intro/ts/src/app/logger.service.ts
rename to public/docs/_examples/architecture/ts/app/logger.service.ts
index 2f7935fba0..c69944101b 100644
--- a/public/docs/_examples/intro/ts/src/app/logger.service.ts
+++ b/public/docs/_examples/architecture/ts/app/logger.service.ts
@@ -1,4 +1,4 @@
-import {Injectable} from 'angular2/angular2';
+import {Injectable} from 'angular2/core';
@Injectable()
export class Logger {
diff --git a/public/docs/_examples/intro/ts/src/index.html b/public/docs/_examples/architecture/ts/index.html
similarity index 57%
rename from public/docs/_examples/intro/ts/src/index.html
rename to public/docs/_examples/architecture/ts/index.html
index 07272ac54b..96b68a3ea8 100644
--- a/public/docs/_examples/intro/ts/src/index.html
+++ b/public/docs/_examples/architecture/ts/index.html
@@ -2,8 +2,8 @@
Intro to Angular 2
-
-
+
+