diff --git a/public/_includes/_util-fns.jade b/public/_includes/_util-fns.jade index 1786e7fd8a..550330210c 100644 --- a/public/_includes/_util-fns.jade +++ b/public/_includes/_util-fns.jade @@ -2,7 +2,7 @@ //- _docsFor: used to identify the language this version of the docs if for; //- Should be one of: 'ts', 'dart' or 'js'. Set in lang specific _util-fns file. -- var _docsFor = ''; +- var _docsFor = ''; //- Should match `_docsFor`, but in this case provides the full capitalized //- name of the language. @@ -29,6 +29,10 @@ - var _Promise = 'Promise'; - var _Observable = 'Observable'; +//- Location of sample code +- var _liveLink = 'live link'; + + //- Used to prefix identifiers that are private. In Dart this will be '_'. - var _priv = ''; @@ -46,7 +50,7 @@ mixin adjExPath(path) | #{adjustExamplePath(path)} else | #{path} - + mixin includeShared(filePath, region) - var newPath = translatePath(filePath, region); !=partial(newPath) @@ -68,13 +72,43 @@ mixin makeExample(_filePath, region, _title, stylePatterns) .example-title #{title} code-example(language="#{language}" format="#{format}") != styleString(frag, stylePatterns) - -//- Like makeExample, but doesn't show line numbers and -//- title is appened with `(excerpt)` if it doesn't already -//- end with a parenthetical remark. -mixin makeExcerpt(_filePath, region, _title, stylePatterns) - - if (_title && !_title.match(/\([\w ]+\)$/)) _title = _title + ' (excerpt)'; - +makeExample(_filePath, region, _title, stylePatterns)(format='.') + +//- Like makeExample, but the first argument is a path that is +//- relative to the project root. Unless title is defined, +//- the project relative path will be used. +mixin makeProjExample(projRootRelativePath, region, title, stylePatterns) + - var relPath = projRootRelativePath.trim(); + - var filePath = getExampleName() + '/ts/' + relPath; + - if (!title) { + - // Is path like styles.1.css? Then drop the '.1' qualifier: + - var matches = relPath.match(/^(.*)\.\d(\.\w+)$/); + - title = matches ? matches[1] + matches[2] : relPath; + - } + +makeExample(filePath, region, title, stylePatterns) + +//- Like makeExample, but doesn't show line numbers, and the first +//- argument is a path that is relative to the example project root. +//- Unless title is defined, the project relative path will be used. +//- Title will always end with a phrase in parentheses; if no such +//- ending is given, then the title will be suffixed with +//- either "(excerpt)", or "(#{region})" when region is defined. +mixin makeExcerpt(projRootRelativePath, region, title, stylePatterns) + - var relPath = projRootRelativePath.trim(); + - var filePath = getExampleName() + '/ts/' + relPath; + - if (!title) { + - // Is path like styles.1.css? Then drop the '.1' qualifier: + - var matches = relPath.match(/^(.*)\.\d(\.\w+)$/); + - title = matches ? matches[1] + matches[2] : relPath; + - } + - var excerpt = region || 'excerpt'; + - if (title && !title.match(/\([\w ]+\)$/)) title = title + ' (' + excerpt + ')'; + +makeExample(filePath, region, title, stylePatterns)(format='.') + +//- Extract the doc example name from `current`. +- var getExampleName = function() { +- var dir = current.path[current.path.length - 1]; +- return dir == 'latest' ? current.source : dir; +- }; mixin makeTabs(filePaths, regions, tabNames, stylePatterns) - filePaths = strSplit(filePaths); @@ -134,7 +168,7 @@ script. el.style.display = isVerbose ? 'block' : 'none'; var el = document.querySelector('button.verbose.on'); el.style.display = isVerbose ? 'none' : 'block'; - + CCSStylesheetRuleStyle('main','.l-verbose-section', 'display', isVerbose ? 'block' : 'none'); } diff --git a/public/docs/_examples/architecture/ts/index.html b/public/docs/_examples/architecture/ts/index.html index e9026e0ffc..e365c39f02 100644 --- a/public/docs/_examples/architecture/ts/index.html +++ b/public/docs/_examples/architecture/ts/index.html @@ -7,7 +7,7 @@ - + diff --git a/public/docs/_examples/attribute-directives/ts/index.html b/public/docs/_examples/attribute-directives/ts/index.html index 6988ae496a..197f1a8280 100644 --- a/public/docs/_examples/attribute-directives/ts/index.html +++ b/public/docs/_examples/attribute-directives/ts/index.html @@ -8,7 +8,7 @@ - + diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/index.html b/public/docs/_examples/cb-a1-a2-quick-reference/ts/index.html index f6c564313f..ee2eb6fdec 100644 --- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/index.html +++ b/public/docs/_examples/cb-a1-a2-quick-reference/ts/index.html @@ -10,7 +10,7 @@ - + diff --git a/public/docs/_examples/tutorial/e2e-spec.js b/public/docs/_examples/cb-barrels/e2e-spec.js similarity index 99% rename from public/docs/_examples/tutorial/e2e-spec.js rename to public/docs/_examples/cb-barrels/e2e-spec.js index f35fcd1287..a109efb5a8 100644 --- a/public/docs/_examples/tutorial/e2e-spec.js +++ b/public/docs/_examples/cb-barrels/e2e-spec.js @@ -4,7 +4,6 @@ describe('Tutorial', function () { browser.get(''); }); - function getPageStruct() { hrefEles = element.all(by.css('my-app a')); diff --git a/public/docs/_examples/tutorial/ts/app/app.component.css b/public/docs/_examples/cb-barrels/ts/app/app.component.css similarity index 100% rename from public/docs/_examples/tutorial/ts/app/app.component.css rename to public/docs/_examples/cb-barrels/ts/app/app.component.css diff --git a/public/docs/_examples/tutorial/ts/app/app.component.ts b/public/docs/_examples/cb-barrels/ts/app/app.component.ts similarity index 81% rename from public/docs/_examples/tutorial/ts/app/app.component.ts rename to public/docs/_examples/cb-barrels/ts/app/app.component.ts index 8b0e0ad8da..926eafc1c9 100644 --- a/public/docs/_examples/tutorial/ts/app/app.component.ts +++ b/public/docs/_examples/cb-barrels/ts/app/app.component.ts @@ -1,12 +1,11 @@ +// #docregion imports import { Component } from '@angular/core'; import { RouteConfig, ROUTER_DIRECTIVES } from '@angular/router-deprecated'; - -import { HeroesComponent } from './heroes.component'; -import { HeroDetailComponent } from './hero-detail.component'; +import { HeroesComponent, HeroDetailComponent, HeroService } from './heroes'; import { DashboardComponent } from './dashboard.component'; -import { HeroService } from './hero.service'; @Component({ +// #enddocregion selector: 'my-app', template: `

{{title}}

@@ -27,5 +26,5 @@ import { HeroService } from './hero.service'; {path: '/detail/:id', name: 'HeroDetail', component: HeroDetailComponent} ]) export class AppComponent { - title = 'Tour of Heroes'; + title = 'Tour of Heroes - Barrels'; } diff --git a/public/docs/_examples/cb-barrels/ts/app/dashboard.component.css b/public/docs/_examples/cb-barrels/ts/app/dashboard.component.css new file mode 100644 index 0000000000..82349dc658 --- /dev/null +++ b/public/docs/_examples/cb-barrels/ts/app/dashboard.component.css @@ -0,0 +1,60 @@ +[class*='col-'] { + float: left; +} +*, *:after, *:before { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +h3 { + text-align: center; margin-bottom: 0; +} +[class*='col-'] { + padding-right: 20px; + padding-bottom: 20px; +} +[class*='col-']:last-of-type { + padding-right: 0; +} +.grid { + margin: 0; +} +.col-1-4 { + width: 25%; +} +.module { + padding: 20px; + text-align: center; + color: #eee; + max-height: 120px; + min-width: 120px; + background-color: #607D8B; + border-radius: 2px; +} +h4 { + position: relative; +} +.module:hover { + background-color: #EEE; + cursor: pointer; + color: #607d8b; +} +.grid-pad { + padding: 10px 0; +} +.grid-pad > [class*='col-']:last-of-type { + padding-right: 20px; +} +@media (max-width: 600px) { + .module { + font-size: 10px; + max-height: 75px; } +} +@media (max-width: 1024px) { + .grid { + margin: 0; + } + .module { + min-width: 60px; + } +} diff --git a/public/docs/_examples/tutorial/ts/app/dashboard.component.html b/public/docs/_examples/cb-barrels/ts/app/dashboard.component.html similarity index 100% rename from public/docs/_examples/tutorial/ts/app/dashboard.component.html rename to public/docs/_examples/cb-barrels/ts/app/dashboard.component.html diff --git a/public/docs/_examples/tutorial/ts/app/dashboard.component.ts b/public/docs/_examples/cb-barrels/ts/app/dashboard.component.ts similarity index 87% rename from public/docs/_examples/tutorial/ts/app/dashboard.component.ts rename to public/docs/_examples/cb-barrels/ts/app/dashboard.component.ts index f08e40a6e1..1239207374 100644 --- a/public/docs/_examples/tutorial/ts/app/dashboard.component.ts +++ b/public/docs/_examples/cb-barrels/ts/app/dashboard.component.ts @@ -1,10 +1,10 @@ +// #docregion imports import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router-deprecated'; - -import { Hero } from './hero'; -import { HeroService } from './hero.service'; +import { Hero, HeroService } from './heroes'; @Component({ +// #enddocregion selector: 'my-dashboard', templateUrl: 'app/dashboard.component.html', styleUrls: ['app/dashboard.component.css'] diff --git a/public/docs/_examples/tutorial/ts/app/hero-detail.component.css b/public/docs/_examples/cb-barrels/ts/app/heroes/hero-detail/hero-detail.component.css similarity index 100% rename from public/docs/_examples/tutorial/ts/app/hero-detail.component.css rename to public/docs/_examples/cb-barrels/ts/app/heroes/hero-detail/hero-detail.component.css diff --git a/public/docs/_examples/cb-barrels/ts/app/heroes/hero-detail/hero-detail.component.html b/public/docs/_examples/cb-barrels/ts/app/heroes/hero-detail/hero-detail.component.html new file mode 100644 index 0000000000..deb47fb3e5 --- /dev/null +++ b/public/docs/_examples/cb-barrels/ts/app/heroes/hero-detail/hero-detail.component.html @@ -0,0 +1,10 @@ +
+

{{hero.name}} details!

+
+ {{hero.id}}
+
+ + +
+ +
diff --git a/public/docs/_examples/tutorial/ts/app/hero-detail.component.ts b/public/docs/_examples/cb-barrels/ts/app/heroes/hero-detail/hero-detail.component.ts similarity index 69% rename from public/docs/_examples/tutorial/ts/app/hero-detail.component.ts rename to public/docs/_examples/cb-barrels/ts/app/heroes/hero-detail/hero-detail.component.ts index 0a168944c0..c945a8f6dd 100644 --- a/public/docs/_examples/tutorial/ts/app/hero-detail.component.ts +++ b/public/docs/_examples/cb-barrels/ts/app/heroes/hero-detail/hero-detail.component.ts @@ -1,13 +1,13 @@ +// #docregion imports import { Component, OnInit } from '@angular/core'; import { RouteParams } from '@angular/router-deprecated'; - -import { Hero } from './hero'; -import { HeroService } from './hero.service'; +import { HeroService, Hero } from '../shared'; @Component({ +// #enddocregion selector: 'my-hero-detail', - templateUrl: 'app/hero-detail.component.html', - styleUrls: ['app/hero-detail.component.css'] + templateUrl: 'app/heroes/hero-detail/hero-detail.component.html', + styleUrls: ['app/heroes/hero-detail/hero-detail.component.css'] }) export class HeroDetailComponent implements OnInit { hero: Hero; diff --git a/public/docs/_examples/cb-barrels/ts/app/heroes/hero-detail/index.ts b/public/docs/_examples/cb-barrels/ts/app/heroes/hero-detail/index.ts new file mode 100644 index 0000000000..e7552e28b4 --- /dev/null +++ b/public/docs/_examples/cb-barrels/ts/app/heroes/hero-detail/index.ts @@ -0,0 +1,2 @@ +// #docregion +export * from './hero-detail.component'; diff --git a/public/docs/_examples/tutorial/ts/app/heroes.component.css b/public/docs/_examples/cb-barrels/ts/app/heroes/heroes.component.css similarity index 100% rename from public/docs/_examples/tutorial/ts/app/heroes.component.css rename to public/docs/_examples/cb-barrels/ts/app/heroes/heroes.component.css diff --git a/public/docs/_examples/tutorial/ts/app/heroes.component.html b/public/docs/_examples/cb-barrels/ts/app/heroes/heroes.component.html similarity index 100% rename from public/docs/_examples/tutorial/ts/app/heroes.component.html rename to public/docs/_examples/cb-barrels/ts/app/heroes/heroes.component.html diff --git a/public/docs/_examples/tutorial/ts/app/heroes.component.ts b/public/docs/_examples/cb-barrels/ts/app/heroes/heroes.component.ts similarity index 72% rename from public/docs/_examples/tutorial/ts/app/heroes.component.ts rename to public/docs/_examples/cb-barrels/ts/app/heroes/heroes.component.ts index 1081aab2bd..6e3b2848f2 100644 --- a/public/docs/_examples/tutorial/ts/app/heroes.component.ts +++ b/public/docs/_examples/cb-barrels/ts/app/heroes/heroes.component.ts @@ -1,13 +1,14 @@ +// #docregion imports import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router-deprecated'; -import { HeroService } from './hero.service'; -import { HeroDetailComponent } from './hero-detail.component'; -import { Hero } from './hero'; +import { HeroService, Hero } from './shared'; +import { HeroDetailComponent } from './hero-detail' @Component({ +// #enddocregion selector: 'my-heroes', - templateUrl: 'app/heroes.component.html', - styleUrls: ['app/heroes.component.css'], + templateUrl: 'app/heroes/heroes.component.html', + styleUrls: ['app/heroes/heroes.component.css'], directives: [HeroDetailComponent] }) export class HeroesComponent implements OnInit { diff --git a/public/docs/_examples/cb-barrels/ts/app/heroes/index.ts b/public/docs/_examples/cb-barrels/ts/app/heroes/index.ts new file mode 100644 index 0000000000..45fa911acd --- /dev/null +++ b/public/docs/_examples/cb-barrels/ts/app/heroes/index.ts @@ -0,0 +1,4 @@ +// #docregion +export * from './hero-detail'; +export * from './heroes.component'; +export * from './shared'; diff --git a/public/docs/_examples/cb-barrels/ts/app/heroes/shared/hero.model.ts b/public/docs/_examples/cb-barrels/ts/app/heroes/shared/hero.model.ts new file mode 100644 index 0000000000..ce714d1c00 --- /dev/null +++ b/public/docs/_examples/cb-barrels/ts/app/heroes/shared/hero.model.ts @@ -0,0 +1,5 @@ +export class Hero { + id: number; + name: string; +} + diff --git a/public/docs/_examples/tutorial/ts/app/hero.service.ts b/public/docs/_examples/cb-barrels/ts/app/heroes/shared/hero.service.ts similarity index 89% rename from public/docs/_examples/tutorial/ts/app/hero.service.ts rename to public/docs/_examples/cb-barrels/ts/app/heroes/shared/hero.service.ts index 7d5c08de07..11d60b97a6 100644 --- a/public/docs/_examples/tutorial/ts/app/hero.service.ts +++ b/public/docs/_examples/cb-barrels/ts/app/heroes/shared/hero.service.ts @@ -1,9 +1,10 @@ +// #docregion imports import { Injectable } from '@angular/core'; - import { HEROES } from './mock-heroes'; @Injectable() export class HeroService { +// #enddocregion getHeroes() { return Promise.resolve(HEROES); } diff --git a/public/docs/_examples/cb-barrels/ts/app/heroes/shared/index.ts b/public/docs/_examples/cb-barrels/ts/app/heroes/shared/index.ts new file mode 100644 index 0000000000..27516fdedd --- /dev/null +++ b/public/docs/_examples/cb-barrels/ts/app/heroes/shared/index.ts @@ -0,0 +1,3 @@ +// #docregion +export * from './hero.model'; +export * from './hero.service'; diff --git a/public/docs/_examples/cb-barrels/ts/app/heroes/shared/mock-heroes.ts b/public/docs/_examples/cb-barrels/ts/app/heroes/shared/mock-heroes.ts new file mode 100644 index 0000000000..80d661a439 --- /dev/null +++ b/public/docs/_examples/cb-barrels/ts/app/heroes/shared/mock-heroes.ts @@ -0,0 +1,17 @@ +// #docregion imports +import { Hero } from './hero.model'; + +export var HEROES: Hero[] = [ +// #enddocregion + + {"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"} +]; diff --git a/public/docs/_examples/tutorial/ts/app/main.ts b/public/docs/_examples/cb-barrels/ts/app/main.ts similarity index 75% rename from public/docs/_examples/tutorial/ts/app/main.ts rename to public/docs/_examples/cb-barrels/ts/app/main.ts index 0e07c5e213..09288fb174 100644 --- a/public/docs/_examples/tutorial/ts/app/main.ts +++ b/public/docs/_examples/cb-barrels/ts/app/main.ts @@ -1,10 +1,11 @@ +// #docregion imports import { bootstrap } from '@angular/platform-browser-dynamic'; import { ROUTER_PROVIDERS } from '@angular/router-deprecated'; - -import { HeroService } from './hero.service'; +import { HeroService } from './heroes'; import { AppComponent } from './app.component'; bootstrap(AppComponent, [ +// #enddocregion ROUTER_PROVIDERS, HeroService ]); diff --git a/public/docs/_examples/tutorial/ts/example-config.json b/public/docs/_examples/cb-barrels/ts/example-config.json similarity index 100% rename from public/docs/_examples/tutorial/ts/example-config.json rename to public/docs/_examples/cb-barrels/ts/example-config.json diff --git a/public/docs/_examples/cb-barrels/ts/index.html b/public/docs/_examples/cb-barrels/ts/index.html new file mode 100644 index 0000000000..65c9742a23 --- /dev/null +++ b/public/docs/_examples/cb-barrels/ts/index.html @@ -0,0 +1,35 @@ + + + + + Angular 2 Tour of Heroes - Barrels + + + + + + + + + + + + + + + + + + + Loading... + + diff --git a/public/docs/_examples/cb-barrels/ts/plnkr.json b/public/docs/_examples/cb-barrels/ts/plnkr.json new file mode 100644 index 0000000000..5f0eca25e7 --- /dev/null +++ b/public/docs/_examples/cb-barrels/ts/plnkr.json @@ -0,0 +1,8 @@ +{ + "description": "Cookbook: Barrels", + "files":[ + "!**/*.d.ts", + "!**/*.js" + ], + "tags": ["cookbook", "barrels"] +} diff --git a/public/docs/_examples/cb-component-communication/ts/index.html b/public/docs/_examples/cb-component-communication/ts/index.html index 20c75e04a5..51adcdaf23 100644 --- a/public/docs/_examples/cb-component-communication/ts/index.html +++ b/public/docs/_examples/cb-component-communication/ts/index.html @@ -10,7 +10,7 @@ - + diff --git a/public/docs/_examples/cb-dependency-injection/ts/index.html b/public/docs/_examples/cb-dependency-injection/ts/index.html index 744fd81a26..ba1d2761e1 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/index.html +++ b/public/docs/_examples/cb-dependency-injection/ts/index.html @@ -11,7 +11,7 @@ - + diff --git a/public/docs/_examples/cb-dynamic-form/ts/index.html b/public/docs/_examples/cb-dynamic-form/ts/index.html index 33998c478e..ec3e1cbbb2 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/index.html +++ b/public/docs/_examples/cb-dynamic-form/ts/index.html @@ -11,7 +11,7 @@ - + diff --git a/public/docs/_examples/cb-set-document-title/ts/index.html b/public/docs/_examples/cb-set-document-title/ts/index.html index f5289d7eb3..8f1ad96812 100644 --- a/public/docs/_examples/cb-set-document-title/ts/index.html +++ b/public/docs/_examples/cb-set-document-title/ts/index.html @@ -15,7 +15,7 @@ - + diff --git a/public/docs/_examples/cb-ts-to-js/js/index.html b/public/docs/_examples/cb-ts-to-js/js/index.html index fb9d760584..b1c1449fb2 100644 --- a/public/docs/_examples/cb-ts-to-js/js/index.html +++ b/public/docs/_examples/cb-ts-to-js/js/index.html @@ -5,7 +5,7 @@ - + diff --git a/public/docs/_examples/cb-ts-to-js/ts/index.html b/public/docs/_examples/cb-ts-to-js/ts/index.html index 80fa73d326..005fe67c31 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/index.html +++ b/public/docs/_examples/cb-ts-to-js/ts/index.html @@ -7,7 +7,7 @@ - + diff --git a/public/docs/_examples/component-styles/ts/index.html b/public/docs/_examples/component-styles/ts/index.html index 45dd7c73ff..9345f5b221 100644 --- a/public/docs/_examples/component-styles/ts/index.html +++ b/public/docs/_examples/component-styles/ts/index.html @@ -7,7 +7,7 @@ - + diff --git a/public/docs/_examples/dependency-injection/ts/index.html b/public/docs/_examples/dependency-injection/ts/index.html index 74708a8852..74f8ed8894 100644 --- a/public/docs/_examples/dependency-injection/ts/index.html +++ b/public/docs/_examples/dependency-injection/ts/index.html @@ -8,7 +8,7 @@ - + diff --git a/public/docs/_examples/displaying-data/ts/index.html b/public/docs/_examples/displaying-data/ts/index.html index 7b96075c09..e74be1c5de 100644 --- a/public/docs/_examples/displaying-data/ts/index.html +++ b/public/docs/_examples/displaying-data/ts/index.html @@ -7,7 +7,7 @@ - + diff --git a/public/docs/_examples/forms/js/index.html b/public/docs/_examples/forms/js/index.html index e214ee3ac1..55b7d2ba1d 100644 --- a/public/docs/_examples/forms/js/index.html +++ b/public/docs/_examples/forms/js/index.html @@ -15,7 +15,7 @@ - + diff --git a/public/docs/_examples/forms/ts/index.html b/public/docs/_examples/forms/ts/index.html index ac457e8f82..4df2d32d46 100644 --- a/public/docs/_examples/forms/ts/index.html +++ b/public/docs/_examples/forms/ts/index.html @@ -15,7 +15,7 @@ - + diff --git a/public/docs/_examples/hierarchical-dependency-injection/ts/index.html b/public/docs/_examples/hierarchical-dependency-injection/ts/index.html index a4109a1625..91d2dc8894 100644 --- a/public/docs/_examples/hierarchical-dependency-injection/ts/index.html +++ b/public/docs/_examples/hierarchical-dependency-injection/ts/index.html @@ -7,7 +7,7 @@ - + diff --git a/public/docs/_examples/homepage-hello-world/ts/index.html b/public/docs/_examples/homepage-hello-world/ts/index.html index 246cecc85d..794935d3bb 100644 --- a/public/docs/_examples/homepage-hello-world/ts/index.html +++ b/public/docs/_examples/homepage-hello-world/ts/index.html @@ -8,7 +8,7 @@ - + diff --git a/public/docs/_examples/homepage-tabs/ts/index.html b/public/docs/_examples/homepage-tabs/ts/index.html index 9abb036d3a..1fe2ebc8ba 100644 --- a/public/docs/_examples/homepage-tabs/ts/index.html +++ b/public/docs/_examples/homepage-tabs/ts/index.html @@ -9,7 +9,7 @@ - + diff --git a/public/docs/_examples/homepage-todo/ts/index.html b/public/docs/_examples/homepage-todo/ts/index.html index 738fed01b9..2bddce017c 100644 --- a/public/docs/_examples/homepage-todo/ts/index.html +++ b/public/docs/_examples/homepage-todo/ts/index.html @@ -9,7 +9,7 @@ - + diff --git a/public/docs/_examples/lifecycle-hooks/ts/index.html b/public/docs/_examples/lifecycle-hooks/ts/index.html index 41ad4848b0..6fa866c6e6 100644 --- a/public/docs/_examples/lifecycle-hooks/ts/index.html +++ b/public/docs/_examples/lifecycle-hooks/ts/index.html @@ -9,7 +9,7 @@ - + diff --git a/public/docs/_examples/package.json b/public/docs/_examples/package.json index fa3fa42886..b7b8afc084 100644 --- a/public/docs/_examples/package.json +++ b/public/docs/_examples/package.json @@ -31,11 +31,13 @@ "@angular/router": "2.0.0-rc.1", "@angular/router-deprecated": "2.0.0-rc.1", "@angular/upgrade": "2.0.0-rc.1", + "systemjs": "0.19.27", - "es6-shim": "^0.35.0", + "core-js": "^2.4.0", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.6", "zone.js": "^0.6.12", + "angular2-in-memory-web-api": "0.0.7", "bootstrap": "^3.3.6" }, diff --git a/public/docs/_examples/pipes/ts/index.html b/public/docs/_examples/pipes/ts/index.html index 445a3d9c1f..0b1a46f328 100644 --- a/public/docs/_examples/pipes/ts/index.html +++ b/public/docs/_examples/pipes/ts/index.html @@ -7,7 +7,7 @@ - + diff --git a/public/docs/_examples/quickstart/js/index.html b/public/docs/_examples/quickstart/js/index.html index 0f9088eaf3..bec42f9dea 100644 --- a/public/docs/_examples/quickstart/js/index.html +++ b/public/docs/_examples/quickstart/js/index.html @@ -10,7 +10,7 @@ - + diff --git a/public/docs/_examples/quickstart/js/package.1.json b/public/docs/_examples/quickstart/js/package.1.json index e5e96f785e..30801c9e48 100644 --- a/public/docs/_examples/quickstart/js/package.1.json +++ b/public/docs/_examples/quickstart/js/package.1.json @@ -17,6 +17,7 @@ "@angular/router-deprecated": "2.0.0-rc.1", "@angular/upgrade": "2.0.0-rc.1", + "core-js": "^2.4.0", "reflect-metadata": "0.1.3", "rxjs": "5.0.0-beta.6", "zone.js": "0.6.12", diff --git a/public/docs/_examples/quickstart/ts/app/main.ts b/public/docs/_examples/quickstart/ts/app/main.ts index 433fd05c80..2aede345e9 100644 --- a/public/docs/_examples/quickstart/ts/app/main.ts +++ b/public/docs/_examples/quickstart/ts/app/main.ts @@ -1,8 +1,8 @@ // #docregion import { bootstrap } from '@angular/platform-browser-dynamic'; -// #docregion app-component +// #docregion import import { AppComponent } from './app.component'; -// #enddocregion app-component +// #enddocregion import bootstrap(AppComponent); diff --git a/public/docs/_examples/quickstart/ts/index.html b/public/docs/_examples/quickstart/ts/index.html index b1be60a776..a0a64d1122 100644 --- a/public/docs/_examples/quickstart/ts/index.html +++ b/public/docs/_examples/quickstart/ts/index.html @@ -11,7 +11,7 @@ - + diff --git a/public/docs/_examples/quickstart/ts/package.1.json b/public/docs/_examples/quickstart/ts/package.1.json index 8be1e8b8c6..88768b56f2 100644 --- a/public/docs/_examples/quickstart/ts/package.1.json +++ b/public/docs/_examples/quickstart/ts/package.1.json @@ -22,7 +22,7 @@ "@angular/upgrade": "2.0.0-rc.1", "systemjs": "0.19.27", - "es6-shim": "^0.35.0", + "core-js": "^2.4.0", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.6", "zone.js": "^0.6.12", diff --git a/public/docs/_examples/quickstart/ts/systemjs.config.1.js b/public/docs/_examples/quickstart/ts/systemjs.config.1.js index 68881c6a3f..6f23f1dade 100644 --- a/public/docs/_examples/quickstart/ts/systemjs.config.1.js +++ b/public/docs/_examples/quickstart/ts/systemjs.config.1.js @@ -1,12 +1,17 @@ // #docregion +/** + * System configuration for Angular 2 samples + * Adjust as necessary for your application needs. + */ (function(global) { // map tells the System loader where to look for things var map = { 'app': 'app', // 'dist', - 'rxjs': 'node_modules/rxjs', + + '@angular': 'node_modules/@angular', 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', - '@angular': 'node_modules/@angular' + 'rxjs': 'node_modules/rxjs' }; // packages tells the System loader how to load when no filename and/or no extension @@ -16,22 +21,21 @@ 'angular2-in-memory-web-api': { defaultExtension: 'js' }, }; - var packageNames = [ - '@angular/common', - '@angular/compiler', - '@angular/core', - '@angular/http', - '@angular/platform-browser', - '@angular/platform-browser-dynamic', - '@angular/router', - '@angular/router-deprecated', - '@angular/testing', - '@angular/upgrade', + var ngPackageNames = [ + 'common', + 'compiler', + 'core', + 'http', + 'platform-browser', + 'platform-browser-dynamic', + 'router', + 'router-deprecated', + 'upgrade', ]; - // add package entries for angular packages in the form '@angular/common': { main: 'index.js', defaultExtension: 'js' } - packageNames.forEach(function(pkgName) { - packages[pkgName] = { main: 'index.js', defaultExtension: 'js' }; + // Add package entries for angular packages + ngPackageNames.forEach(function(pkgName) { + packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' }; }); var config = { diff --git a/public/docs/_examples/quickstart/ts/typings.1.json b/public/docs/_examples/quickstart/ts/typings.1.json index b5324f4199..ab3d27d712 100644 --- a/public/docs/_examples/quickstart/ts/typings.1.json +++ b/public/docs/_examples/quickstart/ts/typings.1.json @@ -1,6 +1,6 @@ { "ambientDependencies": { - "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654", + "core-js": "registry:dt/core-js#0.0.0+20160317120654", "jasmine": "registry:dt/jasmine#2.2.0+20160412134438", "node": "registry:dt/node#4.0.0+20160509154515" } diff --git a/public/docs/_examples/router-deprecated/ts/index.1.html b/public/docs/_examples/router-deprecated/ts/index.1.html index 7a58c4ec50..53a6d4832f 100644 --- a/public/docs/_examples/router-deprecated/ts/index.1.html +++ b/public/docs/_examples/router-deprecated/ts/index.1.html @@ -11,7 +11,7 @@ - + diff --git a/public/docs/_examples/router-deprecated/ts/index.2.html b/public/docs/_examples/router-deprecated/ts/index.2.html index 83c06e1af6..d71bd929cb 100644 --- a/public/docs/_examples/router-deprecated/ts/index.2.html +++ b/public/docs/_examples/router-deprecated/ts/index.2.html @@ -9,7 +9,7 @@ - + diff --git a/public/docs/_examples/router-deprecated/ts/index.3.html b/public/docs/_examples/router-deprecated/ts/index.3.html index 2a5fc893ae..abbb771beb 100644 --- a/public/docs/_examples/router-deprecated/ts/index.3.html +++ b/public/docs/_examples/router-deprecated/ts/index.3.html @@ -9,7 +9,7 @@ - + diff --git a/public/docs/_examples/router-deprecated/ts/index.html b/public/docs/_examples/router-deprecated/ts/index.html index 9ac268d05f..35a6ddfc73 100644 --- a/public/docs/_examples/router-deprecated/ts/index.html +++ b/public/docs/_examples/router-deprecated/ts/index.html @@ -10,7 +10,7 @@ - + diff --git a/public/docs/_examples/router/ts/index.1.html b/public/docs/_examples/router/ts/index.1.html index 6bc706e2e6..c04b769a2c 100644 --- a/public/docs/_examples/router/ts/index.1.html +++ b/public/docs/_examples/router/ts/index.1.html @@ -11,7 +11,7 @@ - + diff --git a/public/docs/_examples/router/ts/index.2.html b/public/docs/_examples/router/ts/index.2.html index d5676ff4b5..01e521e896 100644 --- a/public/docs/_examples/router/ts/index.2.html +++ b/public/docs/_examples/router/ts/index.2.html @@ -9,7 +9,7 @@ - + diff --git a/public/docs/_examples/router/ts/index.3.html b/public/docs/_examples/router/ts/index.3.html index 1be32f1d0d..f60cdd8163 100644 --- a/public/docs/_examples/router/ts/index.3.html +++ b/public/docs/_examples/router/ts/index.3.html @@ -9,7 +9,7 @@ - + diff --git a/public/docs/_examples/router/ts/index.html b/public/docs/_examples/router/ts/index.html index 22ee1a8172..b7b5ba9f7f 100644 --- a/public/docs/_examples/router/ts/index.html +++ b/public/docs/_examples/router/ts/index.html @@ -11,7 +11,7 @@ - + diff --git a/public/docs/_examples/server-communication/dart/example-config.json b/public/docs/_examples/server-communication/dart/example-config.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/public/docs/_examples/server-communication/dart/lib/app_component.dart b/public/docs/_examples/server-communication/dart/lib/app_component.dart new file mode 100644 index 0000000000..55c91e6e4d --- /dev/null +++ b/public/docs/_examples/server-communication/dart/lib/app_component.dart @@ -0,0 +1,31 @@ +// #docplaster +// #docregion +import "package:angular2/core.dart" show Component; + +import "toh/hero_list_component.dart" show HeroListComponent; +import "wiki/wiki_component.dart" show WikiComponent; +import "wiki/wiki_smart_component.dart" show WikiSmartComponent; + +@Component( + selector: "my-app", + template: ''' + + + + ''', + // #enddocregion + /* + // #docregion http-providers + providers: const [ + // in-memory web api provider + const Provider(BrowserClient, + useFactory: HttpClientBackendServiceFactory, deps: const [])], + // #enddocregion http-providers + */ + // #docregion + directives: const [ + HeroListComponent, + WikiComponent, + WikiSmartComponent + ]) +class AppComponent {} diff --git a/public/docs/_examples/server-communication/dart/lib/hero_data.dart b/public/docs/_examples/server-communication/dart/lib/hero_data.dart index 50ec0fab1d..ae0480b98d 100644 --- a/public/docs/_examples/server-communication/dart/lib/hero_data.dart +++ b/public/docs/_examples/server-communication/dart/lib/hero_data.dart @@ -2,7 +2,7 @@ import 'package:http/browser_client.dart'; import 'package:http_in_memory_web_api/http_in_memory_web_api.dart'; -CreateDb createDb = () => { +CreateDb _createDb = () => { 'heroes': [ {"id": "1", "name": "Windstorm"}, {"id": "2", "name": "Bombasto"}, @@ -12,4 +12,4 @@ CreateDb createDb = () => { }; BrowserClient HttpClientBackendServiceFactory() => - new HttpClientInMemoryBackendService(createDb); + new HttpClientInMemoryBackendService(_createDb); diff --git a/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.dart b/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.dart index 58fe0bb40c..23e1d6e9d7 100644 --- a/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.dart +++ b/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.dart @@ -9,7 +9,7 @@ import 'hero_service.dart'; @Component( selector: 'hero-list', templateUrl: 'hero_list_component.html', - styles: const ['.error {color:red;}']) + providers: const [HeroService]) // #docregion component class HeroListComponent implements OnInit { final HeroService _heroService; diff --git a/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.html b/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.html index 86e2deedd6..297ffaa6c6 100644 --- a/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.html +++ b/public/docs/_examples/server-communication/dart/lib/toh/hero_list_component.html @@ -1,4 +1,5 @@ +

Tour of Heroes

Heroes: